Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

AOT compilation fail #23

Closed
naturalfreak opened this issue Jul 14, 2017 · 7 comments
Closed

AOT compilation fail #23

naturalfreak opened this issue Jul 14, 2017 · 7 comments

Comments

@naturalfreak
Copy link

naturalfreak commented Jul 14, 2017

AOT compilation with uglify, npm run build-android-bundle --uglify.

ERROR in 0.js from UglifyJs
Unexpected token: name (SocketBase) [0.js:5094,6]

ERROR in 1.js from UglifyJs
Unexpected token: name (SocketBase) [1.js:4953,6]

ERROR in 2.js from UglifyJs
Unexpected token: name (SocketBase) [2.js:5076,6]

ERROR in 3.js from UglifyJs
Unexpected token: name (SocketBase) [3.js:4967,6]

ERROR in bundle.js from UglifyJs
Unexpected token: name (SocketBase) [bundle.js:10902,6]

tns version 3.1.2

package.json
node 7.10.1
npm 4.2.0

"dependencies": {
    "@angular/animations": "~4.1.3",
    "@angular/common": "~4.1.3",
    "@angular/compiler": "~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/router": "~4.1.3",
    "nativescript-angular": "~3.1.2",
    "nativescript-camera": "~3.0.1",
    "nativescript-fresco": "~3.0.4",
    "nativescript-geolocation": "~3.0.0",
    "nativescript-google-maps-sdk": "~2.3.2",
    "nativescript-imagepicker": "~3.0.2",
    "nativescript-iqkeyboardmanager": "~1.1.0",
    "nativescript-push-notifications": "~0.1.4",
    "nativescript-socket.io": "~0.6.0",
    "nativescript-telerik-ui-pro": "^3.0.1",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "^0.1.10",
    "rxjs": "~5.4.2",
    "tns-core-modules": "^3.1.0",
    "zone.js": "~0.8.12"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~4.1.3",
    "@ngtools/webpack": "~1.4.2",
    "babel-traverse": "6.24.1",
    "babel-types": "6.24.1",
    "babylon": "6.17.0",
    "codelyzer": "^3.0.1",
    "copy-webpack-plugin": "~4.0.1",
    "extract-text-webpack-plugin": "~2.1.0",
    "fs-extra": "^0.30.0",
    "glob": "^7.1.2",
    "lazy": "1.0.11",
    "markdown-snippet-injector": "^0.2.0",
    "nativescript-css-loader": "~0.26.1",
    "nativescript-dev-typescript": "^0.5.0",
    "nativescript-dev-webpack": "~0.7.3",
    "opener": "^1.4.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.0.2",
    "rimraf": "^2.5.3",
    "tar.gz": "^1.0.5",
    "tns-platform-declarations": "^3.1.0",
    "tslint": "^5.4.2",
    "typescript": "~2.3.4",
    "webpack": "~2.6.1",
    "webpack-bundle-analyzer": "^2.8.2",
    "webpack-sources": "~1.0.1"
  }
@naderio
Copy link
Owner

naderio commented Jul 17, 2017

@naturalfreak does removing platforms and running again fixes this issue? if not, does reverting to v0.5.0 resolves the issue?

@naturalfreak
Copy link
Author

No, same problem after removing platforms and reverting to v0.5.0.

@naderio
Copy link
Owner

naderio commented Jul 20, 2017

ok, does it work without --uglify? (it should, works for me with similar setup)

@naderio
Copy link
Owner

naderio commented Jul 27, 2017

@naturalfreak any update here?

@thematan
Copy link

It does work without uglify

@naderio
Copy link
Owner

naderio commented Aug 29, 2017

ok, @naturalfreak @thematan
it appears that the issue is this plugin being compiled from TypeScript to ES2015, and that nativescript-dev-webpack uses uglify-js instead of uglify-es
rolling back compilation target to ES5

@naderio
Copy link
Owner

naderio commented Aug 29, 2017

fixed in v0.7.1

@naderio naderio closed this as completed Aug 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants