-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unexpected token: name (IonRangeSliderModule) #3
Comments
"ng build" without --prod flag worked, and with it, I have got the same issue. It seems like some errors happened while UglifyJs doing its job on this library. |
I am facing the same issue without solution. |
yes, i'm trying. no result. |
ERROR in vendor.366456fc5ebb4b269eba.bundle.js from UglifyJs |
As far as I know ng build --prod runs uglify (stable release) which currently doesn't support es6. If you take a look to this file "my_project/node_modules/ng2-ion-range-slider/lib/ion-range-slider.module.js" it uses let in line 11 which is new stuff from es6. To conclude, I am trying to build locally using es5 instead, but so far I haven't done it yet because this command npm run ngc-build returns error I couldn't figure it out. Hope to add more info about this. If anyone can bring anything else about this would be great. |
Finally I manage to figure it out and solve it. I changed tsconfig.js and look as below. "compilerOptions": {
"target": "es5",
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"lib": [ "es2015", "dom" ],
"outDir": "lib",
"rootDir": "src"
}, I had to change package.json to look as: "devDependencies": {
"@angular/common": "2.4.4",
"@angular/compiler": "2.4.4",
"@angular/compiler-cli": "2.4.4",
"@angular/core": "2.4.4",
"@types/core-js": "^0.9.41",
"typescript": "2.0.9"
},
"dependencies": {
"@angular/core": "2.4.4",
"@types/jquery": "^2.0.40",
"ion-rangeslider": "2.1.6",
"rxjs": "^5.4.0",
"zone.js": "^0.7.8",
"@types/node": "~6.0.60"
} I will fork the project and commit my changes soon. Hope this help anyone. |
hey @guidux, I just submit a PR based on your comments since you didn't provide your fork yet. Is that what you were thinking about ? Can you check the PR @PhilippStein ? |
@umens I merged your pull request #4 and released new version v1.0.3 |
angular/cli 1.0.0-rc.1
npm i --save ng2-ion-range-slider
When run "ng build --prod" i get this error
ERROR in vendor.366456fc5ebb4b269eba.bundle.js from UglifyJs
Unexpected token: name (IonRangeSliderModule) [vendor.366456fc5ebb4b269eba.bundle.js:67797,4]
How fix this?
The text was updated successfully, but these errors were encountered: