NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

iOS crash when running with release flag: Can't find variable: __metadata #1146

Closed nabilzhafri closed 4 years ago

nabilzhafri commented 4 years ago

Simply copy steps from here: https://nativescript.org/blog/upgrading-tips-for-angular-10/

npm i -g @angular/cli // You could be needing to prefix sudo on GNU/Linux and other Unix-like OSes.
npm i -g nativescript // You could be needing to prefix sudo on GNU/Linux and other Unix-like OSes.
npm i -g @nativescript/schematics // You could be needing to prefix sudo on GNU/Linux and other Unix-like OSes.

ng new workspace
cd workspace
ng add @nativescript/schematics --skipAutoGeneratedComponent

// start apps:
npm run ios --> this runs fine
npm run ios -- --release   --> this will cause error below

Any idea why? Tried to search for solution but can't find any. Happens to my existing project as well after upgrading to angular 10. Right now I can't seem to deploy the iOS app due to this issue.

JavaScript stack trace:
file:///app/vendor.js:90935:15
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:84982:90
at file:///app/vendor.js:85830:34
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:42890:97
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:62743:87
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:35266:89
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:64700:87
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:66519:95
at file:///app/vendor.js:71822:34
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/bundle.js:51:47
at __webpack_require__(file:///app/runtime.js:75:34)
at checkDeferredModules(file:///app/runtime.js:44:42)
at webpackJsonpCallback(file:///app/runtime.js:31:39)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at [native code]
at asyncFunctionResume([nativ<…>
JavaScript error:
file:///app/vendor.js:90935:15: JS ERROR ReferenceError: Can't find variable: __metadata
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: ReferenceError: Can't find variable: __metadata
at
file:///app/vendor.js:90935:15
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:84982:90
at file:///app/vendor.js:85830:34
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:42890:97
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:62743:87
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:35266:89
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:64700:87
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/vendor.js:66519:95
at file:///app/vendor.js:71822:34
at __webpack_require__(file:///app/runtime.js:75:34)
at file:///app/bundle.js:51:47
at __webpack_require__(file:///app/runtime.js:75:34)
at checkDeferredModules(file:///app/runtime.js:44:42)
at webpackJsonpCallback(file:///app/runtime.js:31:39)
at anonym<…>
NativeScript caught signal 6.
Native Stack:
1   0x103596171 sig_handler(int)
2   0x7fff522ab5fd _sigtramp
3   0x7fff5219ff39 itoa64
4   0x7fff5219bb7c abort
5   0x7fff500a2858 abort_message
6   0x7fff50093cbf demangling_unexpected_handler()
7   0x7fff51253c0b _objc_terminate()
8   0x7fff500a1c87 std::__terminate(void (*)())
9   0x7fff500a440b __cxa_get_exception_ptr
10  0x7fff500a43d2 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
11  0x7fff51253ad6 _objc_exception_destructor(void*)
12  0x103545b6f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13  0x103597524 -[TNSRuntime executeModule:referredBy:]
14  0x102e8f4bf main
15  0x7fff520ce1fd start
JS Stack:
nabilzhafri commented 4 years ago

Moved to here: https://github.com/NativeScript/NativeScript/issues/8778