ProgressNS / sidekick-feedback

This repository is for feedback regarding NativeScript Sidekick. Use the issues system here to submit feature requests or vote for existing ones.
45 stars 9 forks source link

ERROR in : Error: Cannot find module '@ngtools/webpack/src/utils' #390

Open bradrice opened 5 years ago

bradrice commented 5 years ago

Please, provide the details below:

Did you verify whether this issue has already been reported here?

Yes

Tell us about the problem

When Using Angular AOT with Webpack, I get this error. I can't seem to figure out what would cause it. App builds properly as long as AOT isn't selected in webpack for release.

Which platform(s) does the issue occur on?

iOS

Provide the following version numbers that the issue occurs with:

Version: 1.17.0-v.2019.5.31.1 (latest) NativeScript CLI version: 5.4.2 CLI extension nativescript-cloud version: 1.17.6 CLI extension nativescript-starter-kits version: 0.3.5

Tell us how to recreate the issue in as much detail as possible

Use Sidekick to build Angular App with Webpack Release with AOT selected

Does this issue happen every time?

Yes

main_19-06-28_10-31-08.494.log console_19-06-28_10-31-04.679.log

{
  "description": "Tooling U Class Player",
  "license": "private",
  "readme": "NativeScript Application",
  "repository": "https://github.com/toolingudev/classappnativescript.git",
  "name": "class2tns",
  "version": "0.1.0",
  "scripts": {
    "test": "ng test"
  },
  "nativescript": {
    "id": "com.toolingu.class2tns",
    "tns-android": {
      "version": "5.4.0"
    },
    "tns-ios": {
      "version": "5.4.2"
    }
  },
  "dependencies": {
    "@angular/animations": "8.0.2",
    "@angular/common": "8.0.2",
    "@angular/compiler": "8.0.2",
    "@angular/core": "8.0.2",
    "@angular/forms": "8.0.2",
    "@angular/http": "8.0.0-beta.10",
    "@angular/platform-browser": "8.0.2",
    "@angular/platform-browser-dynamic": "8.0.2",
    "@angular/router": "8.0.2",
    "async-await": "^0.1.40",
    "lodash": "4.17.11",
    "moment": "2.24.0",
    "nativescript-angular": "^8.0.0",
    "nativescript-audio": "5.0.1",
    "nativescript-drop-down": "^4.0.1",
    "nativescript-orientation": "2.2.1",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-ui-listview": "6.2.0",
    "nativescript-ui-sidedrawer": "6.0.0",
    "nativescript-videoplayer": "4.2.1",
    "nativescript-xmlobjects": "^1.1.4",
    "reflect-metadata": "~0.1.8",
    "rxjs": "^6.3.3",
    "tns-core-modules": "^5.4.3",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.800.1",
    "@angular/cli": "^7.0.3",
    "@angular/compiler-cli": "~7.2.0",
    "@ngtools/webpack": "^6.2.7",
    "@types/lodash": "4.14.68",
    "@types/node": "~6.0.60",
    "css-loader": "^2.1.0",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "^1.7.0",
    "nativescript-dev-typescript": "^0.10.0",
    "nativescript-dev-webpack": "^0.24.1",
    "tns-platform-declarations": "^3.4.1",
    "ts-node": "~3.3.0",
    "tslint": "^5.8.0",
    "typescript": "^3.2.4",
    "uglifyjs-webpack-plugin": "^2.1.3",
    "webpack": "^4.29.5"
  },
  "author": "bradrice"
}
tsonevn commented 5 years ago

Hi @bradrice, Can you try upgrading the @ngtools/webpack to ~8.0.0 and clear up the workspace by selecting File->Clean Cloud Workspace? Then try to rebuild the project while using the cloud builds.

bradrice commented 5 years ago

Well that introduced new errors. I can't compile with or without AOT selected that way. If I drop back to my previous package.json and run npm install, I can build again, just not with AOT.

class2tns [19-07-01 10:03:20.845] (CLI) /Users/brice/source/class2tns/node_modules/webpack-cli/bin/cli.js:244 throw err; ^ Error: Cannot find module '@angular/compiler-cli/ngcc' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15) at Function.Module._load (internal/modules/cjs/loader.js:506:25) at Module.require (internal/modules/cjs/loader.js:636:17) at require (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) at Object. (/Users/brice/source/class2tns/node_modules/@ngtools/webpack/src/ngcc_processor.js:10:16) at Module._compile (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) at Object. (/Users/brice/source/class2tns/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:23:26) at Module._compile (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) at Object. (/Users/brice/source/class2tns/node_modules/@ngtools/webpack/src/index.js:13:10) at Module._compile (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) at Object. (/Users/brice/source/class2tns/node_modules/nativescript-dev-webpack/plugins/NativeScriptAngularCompilerPlugin.js:4:19) at Module._compile (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) at Object. (/Users/brice/source/class2tns/webpack.config.js:15:38) at Module._compile (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (/Users/brice/source/class2tns/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) at WEBPACK_OPTIONS (/Users/brice/source/class2tns/node_modules/webpack-cli/bin/convert-argv.js:133:13) at requireConfig (/Users/brice/source/class2tns/node_modules/webpack-cli/bin/convert-argv.js:135:6) at /Users/brice/source/class2tns/node_modules/webpack-cli/bin/convert-argv.js:142:17 at Array.forEach () [19-07-01 10:03:20.881] Build failed. Executing webpack failed with exit code 1.

tsonevn commented 5 years ago

Hi @bradrice, I was able to recreate the new issue. After some tests, I was able to build a project via cloud build with aot, while using the following package.json configuration.

{
  "nativescript": {
    "id": "org.nativescript.issue3901",
    "tns-android": {
      "version": "5.4.0"
    },
    "tns-ios": {
      "version": "5.4.2"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "8.1.0",
    "@angular/common": "8.1.0",
    "@angular/compiler": "8.1.0",
    "@angular/core": "8.1.0",
    "@angular/forms": "8.1.0",
    "@angular/http": "8.0.0-beta.10",
    "@angular/platform-browser": "8.1.0",
    "@angular/platform-browser-dynamic": "8.1.0",
    "@angular/router": "8.1.0",
    "async-await": "^0.1.40",
    "lodash": "4.17.11",
    "moment": "2.24.0",
    "nativescript-angular": "^8.0.0",
    "nativescript-audio": "5.0.1",
    "nativescript-drop-down": "^4.0.1",
    "nativescript-orientation": "2.2.1",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-ui-listview": "6.2.0",
    "nativescript-ui-sidedrawer": "6.0.0",
    "nativescript-videoplayer": "4.2.1",
    "nativescript-xmlobjects": "^1.1.4",
    "reflect-metadata": "~0.1.8",
    "rxjs": "^6.3.3",
    "tns-core-modules": "^5.4.3",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.801.0",
    "@angular/cli": "^8.1.0",
    "@angular/compiler-cli": "~8.1.0",
    "@ngtools/webpack": "~8.0.0",
    "@types/node": "~6.0.60",
    "css-loader": "^2.1.0",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "^1.7.0",
    "nativescript-dev-typescript": "^0.10.0",
    "nativescript-dev-webpack": "^0.24.1",
    "tns-platform-declarations": "^3.4.1",
    "ts-node": "~3.3.0",
    "tslint": "^5.8.0",
    "uglifyjs-webpack-plugin": "^2.1.3",
    "typescript": "3.4.5",
    "webpack": "^4.29.5"
  },
  "gitHead": "8c1a4866a66daab09bf5ef8e5a96472687192373",
  "readme": "NativeScript Application"
}