[TIMOB-25405] Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-01T00:42:21.000+0000 |
Affected Version/s | Release 6.3.0 |
Fix Version/s | Release 6.3.0 |
Components | iOS |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Ewan Harris |
Created | 2017-10-18T12:58:47.000+0000 |
Updated | 2017-11-01T15:27:52.000+0000 |
So this should have been picked up by our appc-js linting. We have a rule to enforce
'use strict';
at the global level, specifically to avoid this issue. In this case it's complaining about a platform-specific CLI command file it's loading; and we know it's iOS only, so there's only two files to look at: - https://github.com/appcelerator/titanium_mobile/blob/6_3_X/iphone/cli/commands/_build.js - https://github.com/appcelerator/titanium_mobile/blob/6_3_X/iphone/cli/commands/_buildModule.js The first one seems to have had aconst
declaration added without a global'use strict';
statement. The PR involved seems to have been merged with a broken build - https://github.com/appcelerator/titanium_mobile/pull/9463 Given that it is merged (and merged PR builds go away after a day), I can't tell if the results included the eslint warning about this issue.https://github.com/appcelerator/titanium_mobile/pull/9535
Just adding that I have this issue with Android and the ticket description says it's iOS only: Here is the console log: [DEBUG] : Copying: /DEVELOPMENT/Sprint10/build/android/intermediates/exploded-aar/support-vector-drawable-25.3.1/assets => /DEVELOPMENT/Sprint10/build/android/bin/assets [TRACE] : Done processing: support-vector-drawable-25.3.1.aar 2017-10-23T06:21:27.379Z | ERROR | An uncaught exception was thrown! Block-scoped declarations (let, const, function, class) not yet supported outside strict mode 2017-10-23T06:21:27.380Z | ERROR | Block-scoped declarations (let, const, function, class) not yet supported outside strict mode 2017-10-23T06:21:27.380Z | TRACE | SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at /Library/Application Support/Titanium/plugins/hyperloop/2.2.0/hooks/android/hyperloop.js:23:21 at Object.
I should add that I am using the latest GA SDK and updated to the latest Hyperloop just now.
I have just tested this against the Continuous Integration Builds (mobilesdk-6.3.0.v20171018084007-osx) and this is not fixed for Android.
This error showed up to me today, I had to remove hyperloop module from project and it's compiling again.
[~mark.henderson@snagr.co.uk] This error will be fixed by upgrading to Node 6.X which you can download from here. https://nodejs.org/en/. As this looks to be a problem in Hyperloop I will file a new ticket to fix the issue there, but I would advise to update to Node 6.X
Yes this has fixed the issue, I can also now build using SDK 6.2.0 but I can't build with anything higher including continuous integration builds at the moment.
[~mark.henderson@snagr.co.uk] What're the issues you're seeing with the builds higher than 6.2.0?
Now I get pages and pages of this if I build higher than 6.2.0: (it seems to somewhat repeat, so I've just included a part of it) [INFO] : art: Rejecting re-init on previously-failed class java.lang.Class
I'm not too familiar with the Android SDK side of things, would you be able to file a ticket with that log and any other information you might have, such as with what Titanium SDK did the log start appearing, what Android device/emulator versions you're using. We're aiming to GA 6.3 fairly soon so any issues like this would be great to get looked at asap. If you're able to reduce down to a simple test case that would be fantastic, to me it appears to be based around TextField usage. Reviewing the SDK code it looks like the files were changed around the 6.2.2 release for TIMOB-25086.
Reopening as this has cropped up again in 6.3.0.v20171031142258 PR: https://github.com/appcelerator/titanium_mobile/pull/9577
FR passed, changes are verified to be in SDK 6.3.0.v20171031181249.