2

For some reason I get this error when I'm building on iOS on my mac.

***** Fatal JavaScript exception - application has been terminated. ***** 
NativeScript encountered a fatal error: Uncaught ReferenceError: __UI_USE_EXTERNAL_RENDERER__ is not defined
at
(file: src/packages/core/bundle-entry-points.ts:7:0)
at ../node_modules/@nativescript/core/bundle-entry-points.js(file:///app/vendor.js:2442:30)
at __webpack_require__(file: src/webpack/bootstrap:816:0)
at fn(file: src/webpack/bootstrap:120:0)
at (file: src/main.ts:1:35)
at ./main.ts(file:///app/bundle.js:6855:30)
at __webpack_require__(file: src/webpack/bootstrap:816:0)
at checkDeferredModules(file: src/webpack/bootstrap:43:0)
at webpackJsonpCallback(file: src/webpack/bootstrap:30:0)
at (file:///app/bundle.js:2:57)
at require(:1:137)
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught ReferenceError: __UI_USE_EXTERNAL_RENDERER__ is not defined
at
(file: src/packages/core/bundle-entry-points.ts:7:0)
at ../node_modules/@nativescript/core/bundle-entry-points.js(file:///app/vendor.js:2442:30)
at __webpack_require__(file: src/webpack/bootstrap:816:0)
at fn(file: src/webpack/bootstrap:120:0)
at (file: src/main.ts:1:35)
at ./main.ts(file:///app/bundle.js:6855:30)
at __webpack_require__(file: src/webpack/bootstrap:816:0)
at checkDeferredModules(file: src/webpack/bootstrap:43:0)
at webpackJsonpCallback(file: src/webpack/bootstrap:30:0)
at (file:///app/bundle.js:2:57)
at require(:1:137)
', reason: '(null)'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff20422fba __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff20193ff5 objc_exception_throw + 48
2   NativeScript                        0x0000000106c2d914 _ZN3tns21NativeScriptException15OnUncaughtErrorEN2v8<…>

Yesterday it worked perfectly fine, so I'm kind of surprised to see an error. I tried cleaning the platforms and upgrading to a newer version, but nothing works.

Nothing has changed for as much as I know.

I also tried testing it with other branches, and even there I get this error.

Any suggestions?

Giovanni
  • 400
  • 1
  • 5
  • 22

1 Answers1

3

Maybe is a problem with your version of @nativescript/webpack, if you migrated to NativeScript 8.1 you should update your version of @nativescript/webpack to 5.0.0 as pointed here

  • This was indeed the answer. Forgot to answer it myself :p – Giovanni Sep 14 '21 at 22:14
  • This certainly is the answer. Unfortunately, it doesn't help me because I have no idea what changes to make to my webpack.config.js file to support version 5, considering that it breaks most of the code I have in that file (which is a lot of code because it's an Angular / Nativescript code sharing project.) – Justin Nov 15 '21 at 14:27
  • @Justin you should consider to migrate your webpack.config.js as the new docs points in https://docs.nativescript.org/webpack.html for webpack 5x it is better, it works out of the box at least if you don't have some custom logic on it but with the new way you could easily migrate your custom webpack logics. – Diego Fernando Murillo Valenci Nov 16 '21 at 00:41
  • @DiegoFernandoMurilloValenci Yeah I attempted to use the default (bare bones) Webpack 5 config file, unfortunately I get an error "window is not defined" when the app boots up. – Justin Nov 17 '21 at 01:14