[ALOY-1572] Alloy doesn't compile external app.js
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-07-10T22:40:26.000+0000 |
Affected Version/s | alloy 1.9.11 |
Fix Version/s | Release 6.2.3, Alloy 1.9.13 |
Components | Tooling |
Labels | n/a |
Reporter | Flavio De Stefano |
Assignee | Feon Sua Xin Miao |
Created | 2017-06-23T12:32:48.000+0000 |
Updated | 2017-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
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...
I made a PR to avoid to define these constants
Hello, Please share a sample project for us to test. Also, provide your environment details.
1_9_X: https://github.com/appcelerator/alloy/pull/838 master: https://github.com/appcelerator/alloy/pull/839
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.