Upgrading to angular 6 fails during angular-cli migration with unexpected token.
See original GitHub issueVersions
6.0.0-rc.5
Repro steps
ng update @angular/cli --migrate-only --from=1
using the following .angular-cli.json file.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "ui-sdk"
},
"packageManager": "yarn",
"apps": [
{
"name": "lib",
"root": "src/lib",
"outDir": "lib",
"assets": [],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "sym",
"styles": [],
"scripts": [
"../../node_modules/@webcomponents/custom-elements/custom-elements.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
},
{
"name": "demo",
"root": "src/demo",
"outDir": "demo",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"polyfills": "polyfills.ts",
"tsconfig": "tsconfig.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "sym",
"styles": [
"vendor.scss",
"styles.scss"
],
"scripts": [
"../../node_modules/@webcomponents/custom-elements/custom-elements.min.js",
"../../vendor/vts.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts",
"e2e": "environments/environment.e2e.ts",
"upgrade": "environments/environment.upgrade.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/lib/tsconfig.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/lib/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/demo/tsconfig.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/demo/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/testing/tsconfig.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/cli/tsconfig.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css"
}
}
Observed behavior
mkrotscheck-a02:sdk mkrotscheck$ ng update @angular/cli --migrate-only --from=1
Updating karma configuration
Updating configuration
Removing old config file (.angular-cli.json)
Writing config file (angular.json)
Unexpected token / in JSON at position 240
Desired behavior
Successful app migration, or helpful error 😃
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:35 (3 by maintainers)
Top Results From Across the Web
ng update: Unexpected token T in JSON at position 0: TF400813
The solution was to remove this dependence, run the ng update and then put again the dependecies on package.json and the update worked....
Read more >Deprecated APIs and features - Angular
This guide contains a summary of all Angular APIs and features that are currently deprecated. Features and APIs that were deprecated in v6...
Read more >angular/angular-cli - Gitter
Anyone that had a problem with node-gyp after migrating to webpack.8 ? ... /lib/node_modules/angular-cli/lib/bootstrap-local.js:30:14) Unexpected token .
Read more >Angular Upgrade Cli Unexpected Token At Position 0 - ADocLib
Usually this error is caused when your server returns HTML which typically begins with DOCTYPE html or html instead of JSON.Valid JSON cannot ......
Read more >nx jest unexpected token 'export' - You.com | The AI Search ...
This means, that a file is not transformed through TypeScript compiler, e.g. because it is a JS file with TS syntax, or it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, After alot of research, I have come up with following solution and got success in updating my local project to Angular 6.0.1:
Please respond and share! Thanks
update: this is still an issue with 6.0 final