ng build --prod problem
Please provide us with the following information:
OS?
Linux mint
Versions.
beta 31
Repro steps.
I'm working with the latest version of @angular/cli and have a weird error in me Angular2 App.
After make a ng build --pro the bundle doesn't work properly, I can see this error in the console:
EXCEPTION: Cannot set property value of # which has only a getter
But,making a no parameters build, works fine,any idea?
This is a chunk of my package.json
"dependencies": { "@angular/common": "^2.4.6", "@angular/compiler": "^2.4.6", "@angular/core": "^2.4.6", "@angular/forms": "^2.4.6", "@angular/http": "^2.4.6", "@angular/platform-browser": "^2.4.6", "@angular/platform-browser-dynamic": "^2.4.6", "@angular/router": "^3.4.0", "body-parser": "^1.16.0", "btoa": "^1.1.2", "compression": "^1.6.2", "config": "^1.24.0", "core-js": "^2.4.1", "cors": "^2.8.1", "express": "^4.14.0", "express-minify": "^0.2.0", "express-uglify": "^0.3.1", "http-proxy-middleware": "^0.17.3", "jsonschema": "^1.1.1", "jsonwebtoken": "^7.2.1", "ng2-bootstrap": "^1.2.6", "nodemailer": "^2.7.2", "request": "^2.79.0", "request-ip": "^1.2.3", "request-promise": "^4.1.1", "rxjs": "^5.0.1", "ts-helpers": "^1.1.1", "winston": "^2.3.1", "zone.js": "^0.7.6" }, "devDependencies": { "@angular/cli": "^1.0.0-beta.31", "@angular/compiler-cli": "^2.4.0", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "codelyzer": "~2.0.0-beta.1", "frisby": "^0.8.5", "jasmine-core": "2.5.2", "jasmine-node": "^1.14.5", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-coverage-istanbul-reporter": "^0.2.0", "karma-jasmine": "^1.0.2", "nodemon": "^1.11.0", "protractor": "~5.1.0", "ts-node": "1.2.1", "tslint": "^4.3.0", "typ
Hi @DanielContreras18881 ,
I've just created a fresh cli project (@angular/cli beta.31) copied all your dependencies and ng build --prod and it worked with no errors. You didnt mention your typescript version so I used 2.1.6.
Perhaps you've migrated from an older cli version? #goodnessSquad
Try turning aot off by adding --aot=false. That fixed a similar issue I had after an upgrade.
Hi, @aviramga I've migrated from beta 28 and my typescript version was 2.0.0, I test changing it to 2.1.6 and the issue persist. @JaredPhelps your solution fix the problem, thank you so much! You can close it.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.