Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1572] Alloy doesn't compile external app.js

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-07-10T22:40:26.000+0000
Affected Version/salloy 1.9.11
Fix Version/sRelease 6.2.3, Alloy 1.9.13
ComponentsTooling
Labelsn/a
ReporterFlavio De Stefano
AssigneeFeon Sua Xin Miao
Created2017-06-23T12:32:48.000+0000
Updated2017-07-11T23:17:36.000+0000

Description

If your Alloy project has an app.js in a subdirectory (example: lib/app.js), it is not compiled. So, if you have a pre-processor constant like OS_IOS or OS_ANDROID in this file, the result is a runtime error because no var defined OS_IOS is found. *This is a critical issue, because Alloy produces a broken app!* PR: https://github.com/appcelerator/alloy/pull/836

Comments

  1. Brian Knorr 2017-06-23

    We are seeing the same issue with the latest Alloy. As a workaround we are setting all the env vars like OS_IOS on the Alloy object in the alloy.js file. This way our javascript files in lib can use Alloy.OS_IOS, etc...
  2. Flavio De Stefano 2017-06-23

    I made a PR to avoid to define these constants
  3. Sharif AbuDarda 2017-06-27

    Hello, Please share a sample project for us to test. Also, provide your environment details.
  4. Feon Sua Xin Miao 2017-07-10

    1_9_X: https://github.com/appcelerator/alloy/pull/838 master: https://github.com/appcelerator/alloy/pull/839
  5. Abir Mukherjee 2017-07-11

    Tested with this environment: Node Version: 6.10.3 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.3-master.20 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.1.1.GA Appcelerator Studio, build: 4.9.0.201705302345 Xcode 8.3.2 Ran test project with app.js in a subfolder, and there were no compile time or runtime errors.

JSON Source