Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25405] Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-11-01T00:42:21.000+0000
Affected Version/sRelease 6.3.0
Fix Version/sRelease 6.3.0
ComponentsiOS
Labelsn/a
ReporterHans Knöchel
AssigneeEwan Harris
Created2017-10-18T12:58:47.000+0000
Updated2017-11-01T15:27:52.000+0000

Description

Comments

  1. Christopher Williams 2017-10-18

    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 a const 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.
  2. Ewan Harris 2017-10-18

    https://github.com/appcelerator/titanium_mobile/pull/9535
  3. Mark Henderson 2017-10-23

    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. (/Library/Application Support/Titanium/plugins/hyperloop/2.2.0/hooks/android/hyperloop.js:413:3) at Module._compile (module.js:413:34) 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 AndroidBuilder. (/Library/Application Support/Titanium/plugins/hyperloop/2.2.0/hooks/hyperloop.js:53:22)
  4. Mark Henderson 2017-10-23

    I should add that I am using the latest GA SDK and updated to the latest Hyperloop just now.
  5. Mark Henderson 2017-10-23

    I have just tested this against the Continuous Integration Builds (mobilesdk-6.3.0.v20171018084007-osx) and this is not fixed for Android.
  6. Marian Kucharcik 2017-10-23

    This error showed up to me today, I had to remove hyperloop module from project and it's compiling again.
  7. Ewan Harris 2017-10-23

    [~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
  8. Mark Henderson 2017-10-23

    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.
  9. Ewan Harris 2017-10-23

    [~mark.henderson@snagr.co.uk] What're the issues you're seeing with the builds higher than 6.2.0?
  10. Mark Henderson 2017-10-23

    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: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/NestedScrollingChild2; [INFO] : art: at org.appcelerator.titanium.view.TiUIView ti.modules.titanium.ui.TextFieldProxy.createView(android.app.Activity) (TextFieldProxy.java:73) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:499) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(org.appcelerator.titanium.proxy.TiViewProxy) (TiViewProxy.java:695) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.add(java.lang.Object) (TiViewProxy.java:588) [INFO] : art: at void ti.modules.titanium.ui.WindowProxy.windowCreated(org.appcelerator.titanium.TiBaseActivity, android.os.Bundle) (WindowProxy.java:261) [INFO] : art: at void org.appcelerator.titanium.TiActivityWindows.windowCreated(org.appcelerator.titanium.TiBaseActivity, int, android.os.Bundle) (TiActivityWindows.java:33) [INFO] : art: at void org.appcelerator.titanium.TiBaseActivity.windowCreated(android.os.Bundle) (TiBaseActivity.java:564) [INFO] : art: at void org.appcelerator.titanium.TiBaseActivity.onCreate(android.os.Bundle) (TiBaseActivity.java:684) [INFO] : art: at void org.appcelerator.titanium.TiActivity.onCreate(android.os.Bundle) (TiActivity.java:21) [INFO] : art: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6910) [INFO] : art: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1123) [INFO] : art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2746) [INFO] : art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2864) [INFO] : art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) [INFO] : art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1567) [INFO] : art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:105) [INFO] : art: at void android.os.Looper.loop() (Looper.java:156) [INFO] : art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6523) [INFO] : art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) [INFO] : art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:941) [INFO] : art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:831) [INFO] : art: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.NestedScrollingChild2" on path: DexPathList[[zip file "/data/app/uk.co.snagr.snagrmobile-1/base.apk"],nativeLibraryDirectories=[/data/app/uk.co.snagr.snagrmobile-1/lib/arm, /data/app/uk.co.snagr.snagrmobile-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /system/vendor/lib, /product/lib]] [INFO] : art: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56) [INFO] : art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380) [INFO] : art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) [INFO] : art: at org.appcelerator.titanium.view.TiUIView ti.modules.titanium.ui.TextFieldProxy.createView(android.app.Activity) (TextFieldProxy.java:73) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:499) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507) [INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(org.appcelerator.titanium.proxy.TiViewProxy) (TiViewProxy.java:695) [INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.add(java.lang.Object) (TiViewProxy.java:588) [INFO] : art: at void ti.modules.titanium.ui.WindowProxy.windowCreated(org.appcelerator.titanium.TiBaseActivity, android.os.Bundle) (WindowProxy.java:261) [INFO] : art: at void org.appcelerator.titanium.TiActivityWindows.windowCreated(org.appcelerator.titanium.TiBaseActivity, int, android.os.Bundle) (TiActivityWindows.java:33) [INFO] : art: at void org.appcelerator.titanium.TiBaseActivity.windowCreated(android.os.Bundle) (TiBaseActivity.java:564) [INFO] : art: at void org.appcelerator.titanium.TiBaseActivity.onCreate(android.os.Bundle) (TiBaseActivity.java:684) [INFO] : art: at void org.appcelerator.titanium.TiActivity.onCreate(android.os.Bundle) (TiActivity.java:21) [INFO] : art: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6910) [INFO] : art: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1123) [INFO] : art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2746) [INFO] : art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2864) [INFO] : art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) [INFO] : art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1567) [INFO] : art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:105) [INFO] : art: at void android.os.Looper.loop() (Looper.java:156) [INFO] : art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6523) [INFO] : art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) [INFO] : art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:941) [INFO] : art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:831) [INFO] : art:
  11. Ewan Harris 2017-10-23

    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.
  12. Ewan Harris 2017-10-31

    Reopening as this has cropped up again in 6.3.0.v20171031142258 PR: https://github.com/appcelerator/titanium_mobile/pull/9577
  13. Abir Mukherjee 2017-11-01

    FR passed, changes are verified to be in SDK 6.3.0.v20171031181249.

JSON Source