ionic-team / ionic-app-scripts

App Build Scripts for Ionic Projects
http://ionicframework.com/
MIT License
608 stars 304 forks source link

Upgrade to 2.0.2 gives Unexpected Token error. #1123

Open wethinkagile opened 7 years ago

wethinkagile commented 7 years ago

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/ http://ionicworldwide.herokuapp.com/

Short description of the problem:

Upgrade gives Unexpected Token error. I am using typescript 2.4

What behavior are you expecting?

No error

Steps to reproduce:

  1. Use my package.json
  2. npm i
  3. ionic serve

Which @ionic/app-scripts version are you using? 2.0.2

Stack Trace

Error
Close
Runtime Error
Unexpected token <
Stack
SyntaxError: Unexpected token <
Ionic Framework: 3.5.2
Ionic App Scripts: 2.0.0
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 8.1.4
OS Platform: macOS Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

package.json

{
  "name": "myprojectt",
  "description": "descr",
  "private": true,
  "engines": {
    "node": "6.11.0",
    "npm": "5.0.4"
  },
  "repository": {
    "type": "git",
    "url": "URL"
  },
  "author": "me",
  "homepage": "page",
  "dependencies": {
    "@angular/animations": "4.1.3",
    "@angular/common": "4.1.3",
    "@angular/compiler": "4.1.3",
    "@angular/compiler-cli": "4.1.3",
    "@angular/core": "4.1.3",
    "@angular/forms": "4.1.3",
    "@angular/http": "4.1.3",
    "@angular/platform-browser": "4.1.3",
    "@angular/platform-browser-dynamic": "4.1.3",
    "@angular/platform-server": "4.1.3",
    "@angular/tsc-wrapped": "4.1.3",
    "@ionic-native/core": "4.0.1",
    "@ionic-native/device": "4.0.1",
    "@ionic-native/diagnostic": "4.0.1",
    "@ionic-native/file": "4.0.1",
    "@ionic-native/file-opener": "4.0.1",
    "@ionic-native/google-analytics": "4.0.1",
    "@ionic-native/in-app-browser": "4.0.1",
    "@ionic-native/keyboard": "4.0.1",
    "@ionic-native/screen-orientation": "4.0.1",
    "@ionic-native/splash-screen": "4.0.1",
    "@ionic-native/status-bar": "4.0.1",
    "@ionic-native/transfer": "4.0.1",
    "@ionic/storage": "2.0.1",
    "@ngrx/core": "^1.2.0",
    "@ngrx/store": "^2.2.2",
    "@ngrx/store-devtools": "^3.2.4",
    "@ngx-translate/core": "6.0.1",
    "@ngx-translate/http-loader": "0.0.3",
    "@types/cordova": "0.0.34",
    "angular-core": "0.0.5",
    "angular2-jwt": "^0.2.2",
    "browserify": "13.1.0",
    "cordova-android": "^6.2.3",
    "cordova-ios": "^4.4.0",
    "cordova-plugin-compat": "^1.1.0",
    "cordova-plugin-console": "^1.0.7",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-file": "^4.3.3",
    "cordova-plugin-file-opener2": "^2.0.19",
    "cordova-plugin-file-transfer": "^1.6.3",
    "cordova-plugin-google-analytics": "^1.8.3",
    "cordova-plugin-inappbrowser": "^1.7.1",
    "cordova-plugin-network-information": "^1.3.3",
    "cordova-plugin-pin-dialog": "^0.1.3",
    "cordova-plugin-screen-orientation": "^2.0.1",
    "cordova-plugin-statusbar": "^2.2.3",
    "cordova-plugin-whitelist": "^1.3.2",
    "cordova-plugin-wkwebview-engine": "git+https://github.com/driftyco/cordova-plugin-wkwebview-engine.git",
    "cordova.plugins.diagnostic": "3.6.4",
    "es6-promise-plugin": "git+https://github.com/vstirbu/PromisesPlugin.git",
    "es6-shim": "0.35.0",
    "install": "0.10.1",
    "intern": "3.2.3",
    "ionic-angular": "3.5.2",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "is-posix-bracket": "^0.1.1",
    "jStat": "1.5.2",
    "moment": "^2.16.0",
    "npm": "5.3.0",
    "reflect-metadata": "0.1.3",
    "require": "2.4.20",
    "rxjs": "^5.4.0",
    "sw-toolbox": "3.4.0",
    "tsify": "2.0.1",
    "tslint": "5.1.0",
    "typescript": "2.4",
    "zone.js": "^0.8.12"
  },
  "devDependencies": {
    "@angular/cli": "^1.3.0-beta.0",
    "@angular/router": "4.1.3",
    "@ionic/app-scripts": "2.0.2",
    "@ionic/cli-plugin-cordova": "1.4.1",
    "@ionic/cli-plugin-ionic-angular": "1.3.2",
    "@types/debug": "0.0.29",
    "@types/js-base64": "2.1.4",
    "@types/karma-jasmine": "0.0.28",
    "@types/node": "7.0.13",
    "angular2-template-loader": "0.6.2",
    "caniuse-lite": "^1.0.30000702",
    "codacy-coverage": "^2.0.2",
    "codecov": "2.1.0",
    "del": "2.2.0",
    "gulp": "3.9.1",
    "gulp-jasmine": "2.4.1",
    "gulp-ll": "1.0.3",
    "gulp-watch": "4.3.9",
    "html-loader": "0.4.5",
    "isparta": "4.0.0",
    "jasmine": "2.5.2",
    "jasmine-core": "2.6.0",
    "js-base64": "2.1.9",
    "karma": "1.6.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "1.0.1",
    "karma-coverage": "^1.1.1",
    "karma-coverage-istanbul-reporter": "1.2.0",
    "karma-coveralls": "^1.1.2",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "karma-junit-reporter": "^1.2.0",
    "karma-mocha-reporter": "2.2.3",
    "karma-phantomjs-launcher": "^1.0.4",
    "karma-remap-istanbul": "0.6.0",
    "karma-sourcemap-loader": "0.3.7",
    "karma-spec-reporter": "0.0.31",
    "karma-typescript-preprocessor": "0.2.1",
    "karma-verbose-reporter": "0.0.3",
    "karma-webpack": "^2.0.3",
    "ngrx-store-freeze": "0.1.0",
    "node-sass": "^4.5.3",
    "null-loader": "0.1.1",
    "proxy-middleware": "^0.15.0",
    "remap-istanbul": "0.6.4",
    "rollup": "^0.45.2",
    "rollup-plugin-commonjs": "^8.0.2",
    "rollup-plugin-json": "^2.3.0",
    "rollup-plugin-node-builtins": "^2.1.2",
    "rollup-plugin-node-globals": "^1.1.0",
    "rollup-plugin-node-resolve": "^3.0.0",
    "rollup-plugin-replace": "^1.1.1",
    "rollup-pluginutils": "^2.0.1",
    "run-sequence": "1.1.5",
    "shebang-command": "^1.2.0",
    "tiny-lr": "^1.0.5",
    "ts-loader": "2.0.3",
    "ts-node": "3.0.2",
    "tslint-eslint-rules": "^4.1.1",
    "tslint-ionic-rules": "0.0.7",
    "tslint-loader": "3.5.2",
    "ws": "^3.0.0"
  },
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve",
    "e2e": "ionic-app-scripts build",
    "start": "ionic serve",
    "test": "ng test",
    "test-coverage": "ng test --code-coverage",
    "test-ci": "ng test --watch=false --code-coverage"
  },
  "config": {
    "ionic_bundler": "rollup",
    "ionic_source_map_type": "source-map",
    "ionic_rollup": "./config/rollup.config.js",
    "ionic_sass": "./config/sass.config.js"
  },
  "cordova": {
    "platforms": [
      "android",
      "ios"
    ],
    "plugins": {
      "cordova-plugin-console": {},
      "cordova-plugin-device": {},
      "cordova-plugin-file": {},
      "cordova-plugin-file-opener2": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "cordova.plugins.diagnostic": {},
      "ionic-plugin-keyboard": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-pin-dialog": {},
      "cordova-plugin-google-analytics": {},
      "cordova-plugin-wkwebview-engine": {},
      "cordova-plugin-screen-orientation": {}
    }
  }
}
mhartington commented 7 years ago

You upgraded to typescript 2.4, which a few libs still do not support. Downgrade to typescript 2.3.4

npm install typescript@2.3.4 --save --save-exact
wethinkagile commented 7 years ago

me@my-mbp ~/d/project-mobile-front> npm install typescript@2.3.4 --save --save-exact npm notice save typescript is being moved from dependencies to devDependencies

  • typescript@2.3.4 added 1 package in 10.237s

Still same error, I am trying tsconfig options now, but no success so far. Also see: https://github.com/ionic-team/ionic-app-scripts/issues/1097