NativeScript / nativescript-dev-webpack

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

ERROR in this.compiler.compileAll is not a function #329

Closed henrychavez closed 6 years ago

henrychavez commented 6 years ago

I having this error ERROR in this.compiler.compileAll is not a function when I run npm run build-android-bundle.

This is my dependencies:

"tns-android": {
      "version": "3.3.1"
    },
    "tns-ios": {
      "version": "3.3.0"
    },
"dependencies": {
    "@angular/animations": "~4.4.1",
    "@angular/common": "~4.4.1",
    "@angular/compiler": "~4.4.1",
    "@angular/core": "~4.4.1",
    "@angular/forms": "~4.4.1",
    "@angular/http": "~4.4.1",
    "@angular/platform-browser": "~4.4.1",
    "@angular/router": "~4.4.1",
    "@types/lodash": "^4.14.73",
    "angular2-moment": "^1.7.0",
    "card-validator": "^4.1.0",
    "email-validator": "^1.1.1",
    "lodash": "^4.17.4",
    "nativescript-angular": "~4.4.0",
    "nativescript-appversion": "^1.4.1",
    "nativescript-barcodescanner": "^2.6.1",
    "nativescript-bottom-navigation": "^1.1.0",
    "nativescript-clipboard": "^1.1.6",
    "nativescript-contacts-lite": "^0.2.3",
    "nativescript-email": "^1.5.1",
    "nativescript-fabric": "^1.0.6-ci-build-19",
    "nativescript-feedback": "^1.1.0",
    "nativescript-floatingactionbutton": "^4.1.2",
    "nativescript-iqkeyboardmanager": "^1.1.0",
    "nativescript-loading-indicator": "^2.3.2",
    "nativescript-ngx-fonticon": "^2.2.3",
    "nativescript-plugin-firebase": "^4.2.1",
    "nativescript-pulltorefresh": "^2.0.2",
    "nativescript-slides": "^2.2.11",
    "nativescript-snackbar": "^1.3.0",
    "nativescript-social-share": "^1.4.0",
    "nativescript-stringformat": "^2.3.4",
    "nativescript-swiss-army-knife": "^3.0.0",
    "nativescript-theme-core": "~1.0.2",
    "nativescript-toast": "^1.4.6",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.4.2",
    "tns-core-modules": "^3.3.0",
    "zone.js": "~0.8.2"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~4.1.0",
    "@ngtools/webpack": "~1.6.0",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "copy-webpack-plugin": "~4.0.1",
    "cross-env": "^5.1.1",
    "extract-text-webpack-plugin": "~3.0.0",
    "lazy": "1.0.11",
    "mkdirp": "^0.5.1",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-sass": "^1.3.5",
    "nativescript-dev-typescript": "~0.5.0",
    "nativescript-dev-webpack": "^0.8.0",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.1.0",
    "tns-platform-declarations": "^3.1.1",
    "typescript": "~2.4.2",
    "webpack": "~3.2.0",
    "webpack-bundle-analyzer": "^2.8.2",
    "webpack-sources": "~1.0.1"
  },
NickIliev commented 6 years ago

@henrychavez the error is caused by a mismatch in your angular/compiler-cli version (against the other Angular dependencies). If you are unsure what is the correct version to install, then you can use the automated script located in nativescript-dev-webpack.

cd node_modules/nativescript-dev-webpack/bin
./update-ns-webpack
cd ../../../
npm i

After the update script is executed, you should the list of updated versions

For example

Adding dev dependency: @angular/compiler-cli@~4.4.1
henrychavez commented 6 years ago

@NickIliev Thanks for your help!

Now it's working