Description
When building to an iOS 9 device/simulator the following error is seen, it's probable this is down to some of the recent refactorings in the build scripts relating to ti.main
[ERROR] Script Error {
[ERROR] column = 119;
[ERROR] line = 5633;
[ERROR] message = "undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(TypedArrayPrototype, Symbol.toStringTag).get')";
[ERROR] sourceURL = "file:///Users/awam/Library/Developer/CoreSimulator/Devices/D1F3D800-B22D-43F1-A517-7BF234508D73/data/Containers/Bundle/Application/4F541A06-7C24-4A32-9595-CBD8F3410E48/ticreateapp.app/ti.main.js";
[ERROR] stack = " at global code(/ti.main.js:5633:119)";
[ERROR] }
Steps to reproduce
1. Build an app to iOS 9
Actual
Error above
Expected
App should launch fine
With SDK *8.2.0.GA* there is no problem, the problems started with *SDK8.3*
Tracked this down to [these lines](https://github.com/appcelerator/titanium_mobile/blob/74d78fb89404122f278600933c3fb9e3e32cf4d8/common/Resources/ti.internal/extensions/node/internal/util/types.js#L29-L32). Looking into the app under the debugger the
Object.getOwnPropertyDescriptor(TypedArrayPrototype, Symbol.toStringTag)
call returns null, it looks likeSymbol.toStringTag
isn't implemented in JSCore in iOS 9 (confirmed by debugging a website there), but is polyfilled by core-js for us. Looking at core-js, the node team raised this issue also https://github.com/zloirock/core-js/issues/378. We might need to update to core-js 3 to fix this (or try and patch it ourselves like we did for [Error.toJSON](https://github.com/appcelerator/titanium_mobile/blob/74d78fb89404122f278600933c3fb9e3e32cf4d8/common/Resources/ti.internal/extensions/js/Error.js#L13-L21)) cc [~jvennemann] [~cwilliams]Might be a good opportunity to replace the deprecated
@babel/polyfill
with core-js directly like mentioned on the [@babel/polyfill](https://babeljs.io/docs/en/babel-polyfill) website.master: https://github.com/appcelerator/titanium_mobile/pull/11289
I urgently need to solve this problem with devices that mount iOS 9. It's possible to put this fix in a nightly build https://builds.appcelerator.com/#master ? Thank you
[~nicolomonili], you can build your own nightly including the outstanding PR in just a few simple steps.
If you don't specify a specific platform (either
android
orios
), the SDK will be build for both.8_3_X: https://github.com/appcelerator/titanium_mobile/pull/11322
FR Passed on 8_3_X
FR Passed on Master, waiting on Jenkins builds for 8_3_X and Master.
merged to master and 8_3_X
*Closing ticket*, Verified fix on SDK version
9.0.0.v20191111145151
and8.3.0.v20191111195828
. Test and other information can be found at: 8_3_X: https://github.com/appcelerator/titanium_mobile/pull/11322 Master: https://github.com/appcelerator/titanium_mobile/pull/11289