NativeScript / NativeScript

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
https://nativescript.org
MIT License
24.26k stars 1.64k forks source link

NativeScript 8 and Angular 12 - Unable to create application com.tns.NativeScriptApplication #9472

Open rlnd1 opened 3 years ago

rlnd1 commented 3 years ago

Environment tns info:

✔ Component nativescript has 8.0.2 version and is up to date.
✔ Component @nativescript/core has 8.0.8 version and is up to date.
✔ Component @nativescript/ios has 8.0.0 version and is up to date.
✔ Component @nativescript/android has 8.0.0 version and is up to date.

package.json:

{
  "name": "CampusMobile",
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "scripts": {
    "lint": "tslint \"src/**/*.ts\"",
    "ngcc": "ngcc --properties es2015 module main --first-only",
    "postinstall": "npm run ngcc",
    "tns": "tns"
  },
  "dependencies": {
    "@angular/animations": "~12.1.2",
    "@angular/common": "~12.1.2",
    "@angular/compiler": "~12.1.2",
    "@angular/core": "~12.1.2",
    "@angular/forms": "~12.1.2",
    "@angular/platform-browser": "~12.1.2",
    "@angular/platform-browser-dynamic": "~12.1.2",
    "@angular/router": "~12.1.2",
    "@nativescript-community/ui-mapbox": "^6.2.7",
    "@nativescript-community/ui-material-tabs": "^5.3.10",
    "@nativescript/angular": "~12.0.0",
    "@nativescript/auto-fit-text": "^1.0.1",
    "@nativescript/core": "~8.0.0",
    "@nativescript/datetimepicker": "^2.1.0",
    "@nativescript/directions": "^2.0.0",
    "@nativescript/email": "^2.0.3",
    "@nativescript/firebase": "^11.1.3",
    "@nativescript/geolocation": "^7.0.0",
    "@nativescript/localize": "^5.0.4",
    "@nativescript/secure-storage": "^3.0.0",
    "@nativescript/social-share": "^2.0.4",
    "@nativescript/theme": "^2.5.0",
    "@nota/nativescript-webview-ext": "^7.0.3",
    "@nstudio/nativescript-cardview": "^2.0.1",
    "@nstudio/nativescript-checkbox": "^2.0.4",
    "@nstudio/nativescript-snackbar": "^2.1.0",
    "date-fns": "^2.19.0",
    "jwt-decode": "^2.2.0",
    "nativescript": "^7.2.1",
    "nativescript-carousel": "^7.0.1",
    "nativescript-feedback": "^2.0.0",
    "nativescript-ui-listview": "^9.1.0",
    "reflect-metadata": "~0.1.12",
    "rxjs": "^6.6.6",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.1.2",
    "@angular/cli": "~12.1.2",
    "@angular/compiler-cli": "~12.1.2",
    "@nativescript/android": "8.0.0",
    "@nativescript/ios": "8.0.0",
    "@nativescript/schematics": "^10.1.0",
    "@nativescript/types": "~8.0.0",
    "@nativescript/webpack": "~5.0.0-beta.0",
    "@ngtools/webpack": "~12.0.0",
    "@schematics/angular": "^10.2.3",
    "@typescript-eslint/eslint-plugin": "^4.22.0",
    "@typescript-eslint/parser": "^4.22.0",
    "codelyzer": "^6.0.0",
    "eslint": "^7.24.0",
    "eslint-config-prettier": "^8.1.0",
    "node-sass": "^4.7.1",
    "prettier": "2.2.1",
    "tslint": "~5.19.0",
    "typescript": "~4.3.5"
  },
  "gitHead": "fa98f785df3fba482e5e2a0c76f4be1fa6dc7a14",
  "readme": "NativeScript Application",
  "main": "./src/main.ts"
}

tsconfig.json:

{
  "compilerOptions": {
    "module": "esnext",
    "target": "es2017",
    "experimentalDecorators": true,
    "noEmitHelpers": true,
    "noEmitOnError": true,
    "skipLibCheck": true,
    "lib": ["es6", "dom", "es2015.iterable", "es2016", "es2017", "es2018"],
    "baseUrl": ".",
    "paths": {
      "~/*": ["src/*"],
      "*": ["./node_modules/*"],
      "@uni-campus/*": ["../../libs/*/index", "../../libs/*"]
    },
    "moduleResolution": "node",
    "removeComments": false
  },
  "include": ["references.d.ts", "src/tests/**/*.ts", "../src", "**/*"],
  "files": ["./src/main.ts", "./references.d.ts", "./src/polyfills.ts"],
  "exclude": ["node_modules", "platforms", "e2e"]
}

main.ts and polyfills.ts as in https://blog.nativescript.org/nativescript-angular-12/index.html

Describe the bug I try to update the NS 8.0 application to Angular 12. I followed the update guide from the NativeScript blog. If I try to run the app, webpack outputs some warnings, but the build succeeds. However, after launching, the app crashes immediately. I deleted the platforms folder before running.

Webpack warnings:

WARNING in ./node_modules/@nativescript/localize/resource.common.js 3:81-97
export 'unique' (imported as 'shorthash') was not found in 'shorthash' (module has no exports)
 @ ./node_modules/@nativescript/localize/resource.android.js 2:0-44 3:0-46 3:0-46 5:17-24
 @ ./node_modules/@nativescript/localize/index.android.js 3:0-39 16:63-72
 @ ./node_modules/@nativescript/localize/angular/fesm2015/nativescript-localize-angular.js 2:0-50 7:15-23
 @ ./src/app/app.module.ts 8:0-76 41:12-38
 @ ./src/main.ts 4:0-45 6:69-78

WARNING in ./node_modules/inherits/inherits.js 2:13-28
Module not found: Error: Can't resolve 'util' in 'C:\Users\Roland\Documents\FDN\uni-campus-app\apps\campus-mobile\node_modules\inherits'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }
 @ ./node_modules/css/lib/stringify/compress.js 7:15-34
 @ ./node_modules/css/lib/stringify/index.js 6:17-38
 @ ./node_modules/css/index.js 2:0-46
 @ ./node_modules/@nativescript/core/ui/styling/style-scope.js 2:0-46 201:32-40
 @ ./node_modules/@nativescript/core/ui/core/view/view-common.js 12:0-55 77:24-34
 @ ./node_modules/@nativescript/core/ui/frame/frame-common.js 8:0-68 521:32-56 600:4-11
 @ ./node_modules/@nativescript/core/ui/frame/index.android.js 3:0-67 13:0-31 13:0-31 59:27-36 89:15-50 92:8-43 95:15-42 98:8-35 278:31-53 327:94-116 578:23-29 1062:49-65

1 warning has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

ERROR in ./node_modules/css/lib/stringify/source-map-support.js 9:9-22
Module not found: Error: Can't resolve 'fs' in 'C:\Users\Roland\Documents\FDN\uni-campus-app\apps\campus-mobile\node_modules\css\lib\stringify'
 @ ./node_modules/css/lib/stringify/index.js 32:21-52
 @ ./node_modules/css/index.js 2:0-46
 @ ./node_modules/@nativescript/core/ui/styling/style-scope.js 2:0-46 201:32-40
 @ ./node_modules/@nativescript/core/ui/core/view/view-common.js 12:0-55 77:24-34
 @ ./node_modules/@nativescript/core/ui/frame/frame-common.js 8:0-68 521:32-56 600:4-11
 @ ./node_modules/@nativescript/core/ui/frame/index.android.js 3:0-67 13:0-31 13:0-31 59:27-36 89:15-50 92:8-43 95:15-42 98:8-35 278:31-53 327:94-116 578:23-29 1062:49-65

ERROR in ./node_modules/css/lib/stringify/source-map-support.js 10:11-26
Module not found: Error: Can't resolve 'path' in 'C:\Users\Roland\Documents\FDN\uni-campus-app\apps\campus-mobile\node_modules\css\lib\stringify'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
 @ ./node_modules/css/lib/stringify/index.js 32:21-52
 @ ./node_modules/css/index.js 2:0-46
 @ ./node_modules/@nativescript/core/ui/styling/style-scope.js 2:0-46 201:32-40
 @ ./node_modules/@nativescript/core/ui/core/view/view-common.js 12:0-55 77:24-34
 @ ./node_modules/@nativescript/core/ui/frame/frame-common.js 8:0-68 521:32-56 600:4-11
 @ ./node_modules/@nativescript/core/ui/frame/index.android.js 3:0-67 13:0-31 13:0-31 59:27-36 89:15-50 92:8-43 95:15-42 98:8-35 278:31-53 327:94-116 578:23-29 1062:49-65

ERROR in ./node_modules/source-map-resolve/index.js 3:14-29
Module not found: Error: Can't resolve 'path' in 'C:\Users\Roland\Documents\FDN\uni-campus-app\apps\campus-mobile\node_modules\source-map-resolve'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
 @ ./node_modules/css/lib/stringify/source-map-support.js 8:23-52
 @ ./node_modules/css/lib/stringify/index.js 32:21-52
 @ ./node_modules/css/index.js 2:0-46
 @ ./node_modules/@nativescript/core/ui/styling/style-scope.js 2:0-46 201:32-40
 @ ./node_modules/@nativescript/core/ui/core/view/view-common.js 12:0-55 77:24-34
 @ ./node_modules/@nativescript/core/ui/frame/frame-common.js 8:0-68 521:32-56 600:4-11
 @ ./node_modules/@nativescript/core/ui/frame/index.android.js 3:0-67 13:0-31 13:0-31 59:27-36 89:15-50 92:8-43 95:15-42 98:8-35 278:31-53 327:94-116 578:23-29 1062:49-65

Error log:

Restarting application on device ce12160c3ac3d21705...
Successfully synced application ch.unibe.campusapp on device ce12160c3ac3d21705.
System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
System.err: TypeError: Cannot read property 'equals' of undefined
System.err: File: (file: src\webpack:\CampusMobile\webpack\bootstrap:27:0)
System.err:
System.err: StackTrace:
System.err: ./node_modules/@nativescript/core/ui/styling/style-properties.js(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\ui\styling\style-properties.js:718:22)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view-base/index.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:95336:83)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view/view-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:97450:68)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:96324:70)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/content-view/index.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:93304:68)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/page/page-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:108066:71)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/page/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:107905:70)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/frame/frame-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:100758:63)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/frame/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:101526:71)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/dialogs/dialogs-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:98939:64)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/dialogs/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:99121:73)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at (file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:259:50)        
System.err:     at loadModule(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:202:0)
System.err:     at get(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:8:0)        
System.err:     at patchMethod(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:968:0)
System.err:     at (file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:2741:0)
System.err:     at __load_patch(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:91:0)
System.err:     at ./node_modules/zone.js/fesm2015/zone.js(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:2737:0)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./src/polyfills.ts(file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2497:65)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at __webpack_exec__(file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2569:39)
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2570:71)
System.err:     at __webpack_require__.X(file: src\webpack:\CampusMobile\webpack\runtime\startup entrypoint:6:0)    
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2570:47)
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2575:3)
System.err:     at require(:1:266)
System.err:
System.err:
System.err: TypeError: Cannot read property 'equals' of undefined
System.err:
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
System.err: TypeError: Cannot read property 'equals' of undefined
System.err: File: (file: src\webpack:\CampusMobile\webpack\bootstrap:27:0)
System.err:
System.err: StackTrace:
System.err: ./node_modules/@nativescript/core/ui/styling/style-properties.js(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\ui\styling\style-properties.js:718:22)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view-base/index.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:95336:83)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view/view-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:97450:68)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:96324:70)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/content-view/index.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:93304:68)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/page/page-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:108066:71)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/page/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:107905:70)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/frame/frame-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:100758:63)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/frame/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:101526:71)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/dialogs/dialogs-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:98939:64)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/dialogs/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:99121:73)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at (file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:259:50)        
System.err:     at loadModule(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:202:0)
System.err:     at get(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:8:0)        
System.err:     at patchMethod(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:968:0)
System.err:     at (file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:2741:0)
System.err:     at __load_patch(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:91:0)
System.err:     at ./node_modules/zone.js/fesm2015/zone.js(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:2737:0)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./src/polyfills.ts(file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2497:65)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at __webpack_exec__(file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2569:39)
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2570:71)
System.err:     at __webpack_require__.X(file: src\webpack:\CampusMobile\webpack\runtime\startup entrypoint:6:0)    
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2570:47)
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2575:3)
System.err:     at require(:1:266)
System.err:
System.err:
System.err: TypeError: Cannot read property 'equals' of undefined
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6065)
System.err:     at android.app.ActivityThread.-wrap1(Unknown Source:0)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:105)
System.err:     at android.os.Looper.loop(Looper.java:164)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6944)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
System.err: Caused by: com.tns.NativeScriptException: Error calling module function
System.err: TypeError: Cannot read property 'equals' of undefined
System.err: File: (file: src\webpack:\CampusMobile\webpack\bootstrap:27:0)
System.err:
System.err: StackTrace: 
System.err: ./node_modules/@nativescript/core/ui/styling/style-properties.js(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\ui\styling\style-properties.js:718:22)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view-base/index.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:95336:83)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view/view-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:97450:68)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/core/view/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:96324:70)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/content-view/index.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:93304:68)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/page/page-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:108066:71)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/page/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:107905:70)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/frame/frame-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:100758:63)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/frame/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:101526:71)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/dialogs/dialogs-common.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:98939:64)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./node_modules/@nativescript/core/ui/dialogs/index.android.js(file:///data/data/ch.unibe.campusapp/files/app/vendor.js:99121:73)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at (file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:259:50)        
System.err:     at loadModule(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:202:0)
System.err:     at get(file: src\webpack:\CampusMobile\node_modules\@nativescript\core\globals\index.js:8:0)        
System.err:     at patchMethod(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:968:0)
System.err:     at (file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:2741:0)
System.err:     at __load_patch(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:91:0)
System.err:     at ./node_modules/zone.js/fesm2015/zone.js(file: src\webpack:\CampusMobile\node_modules\zone.js\fesm2015\zone.js:2737:0)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at fn(file: src\webpack:\CampusMobile\webpack\runtime\hot module replacement:61:0)
System.err:     at ./src/polyfills.ts(file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2497:65)
System.err:     at __webpack_require__(file: src\webpack:\CampusMobile\webpack\bootstrap:24:0)
System.err:     at __webpack_exec__(file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2569:39)
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2570:71)
System.err:     at __webpack_require__.X(file: src\webpack:\CampusMobile\webpack\runtime\startup entrypoint:6:0)    
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2570:47)
System.err:     at (file:///data/data/ch.unibe.campusapp/files/app/bundle.js:2575:3)
System.err:     at require(:1:266)
System.err:
System.err:
System.err: TypeError: Cannot read property 'equals' of undefined
System.err:     at com.tns.Runtime.runModule(Native Method)
System.err:     at com.tns.Runtime.runModule(Runtime.java:689)
System.err:     at com.tns.Runtime.run(Runtime.java:681)
System.err:     at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1125)
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6062)
System.err:     ... 8 more
Archez commented 3 years ago

This may or may not be your issue, but your package json is referencing @nativescript/webpack: '~5.0.0-beta.0', It is possible the version specified in your lock file is too low of a version for Angular 12. You should try upgrading it to 5.0.0-beta.15 or use @nativescript/webpack@beta to grab the latest beta and see if that helps.

rlnd1 commented 3 years ago

Thank you for your help. Unfortunately, the problem stays the same (even the Webpack logs).

sublime392 commented 3 years ago

I think check the rest of your imports. Like "nativescript": "^7.2.1",. I don't think that should be in there. And in the dev area you have "@nativescript/schematics": "^10.1.0",, but that is no longer a thing with {N}8.

liuy97 commented 2 years ago

@rlnd1 , I get a similar exception. I fix it by adding source-map in devDependencies of package.json

"source-map": "~0.6.0",

maybe you can try it.