Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1690] sourcemaps not being generated for files under lib

GitHub Issuen/a
Resolution Date2019-06-20T19:13:21.000+0000
Affected Version/sAlloy 1.13.9
Fix Version/sCLI Release 7.1.0, Alloy 1.14.0
ReporterEwan Harris
AssigneeEwan Harris



Alloy should be generating sourcemaps for files under lib according to ALOY-616 but this currently is not occurring. It looks like this was broken in ALOY-1262 as it checks whether the target file (i.e the file we're about to write exists) rather than the file we're generating the sourcemap for.

Steps to reproduce

1. Compile kitchensink-v2 \[appc\] alloy compile --config platform=ios 2. Check the sourcemap directory ls ./build/map/Resources/iphone


There should be actionbar.js.map, logger.js.map, and, permissions.js.map files in that folder


Those files do not exist


  1. Ewan Harris 2019-05-24

    Looking closer at this, the whole sourcemapping for the lib files seems off. It's setting the filename in the sourcemaps to a non-existent .js file under the build/map directory, however after some reading/looking at controller sourcemapping filename should be the filename for the file the sourcemap represents in the classic code at runtime e.g. Resources/alloy/logger.js for app/lib/logger.js.
  2. Ewan Harris 2019-05-29

    Included in ALOY-1612 https://github.com/appcelerator/alloy/pull/893/commits/900be2d4679674fd5d84aa5571cff9bb0a48976e
  3. Christopher Williams 2019-06-19

    Note that there is still an unresolved known issue here in that while the external source maps are generated in the build/map folder - the copied file under Resources/ *does not* have a //# sourcemappingURL= comment pointing to it, so babel/Studio/Safari/Chrome DevTools aren't aware of it and able to "carry" it forward like files under app/ are. I think another ticket should be opened to fix that issue as well, otherwise under the debugger for the "source" file you set the Resources/<platform>/file.js path/file rather then the path/file from app/lib/file.js (Additionally, it's entirely possible the source map for the file is wrong due to a post-processing run of the "optimizer". The fix for this is more involved and requires doing the optimizing, source map generation and writing of the copied/generated file all at once, rather than as 3 separate steps.
  4. Keerthi Mahalingam 2019-06-20

    Tested and Verified the Fix on cli 7.1.0-master.22. actionbar.js.map, logger.js.map, and, permissions.js.map files were shown when complied.Works as expected. Closing.
         Name                        = Mac OS X
         Version                     = 10.13.6
         Architecture                = 64bit
         Node.js Version             = 8.9.1
         npm Version                 = 5.5.1
       Titanium CLI
         CLI Version                 = 5.1.1
       Studio version =
       Cli =7.1.0-master.22

JSON Source