Skip to content

ng update @angular/cli --next failed #16056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
doggy8088 opened this issue Nov 4, 2019 · 2 comments
Closed

ng update @angular/cli --next failed #16056

doggy8088 opened this issue Nov 4, 2019 · 2 comments
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@doggy8088
Copy link
Contributor

doggy8088 commented Nov 4, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No.

Description

I'm upgrading from 8.3.17. It failed without any detail. Just said Invalid JSON character: "{" at 74:32.. I'm sure my JSON file (angular.json) is valid.

🔬 Minimal Reproduction

🔥 Exception or Error

ng update @angular/cli  --next --migrate-only --from 8 --verbose

Locating potential npmrc files:
Trying 'C:\Program Files\nodejs\etc\npmrc'...not found.
Trying 'C:\Users\user\.npmrc'...found.
Trying 'C:\Projects\.npmrc'...not found.
Trying 'C:\Projects\.npmrc'...not found.
Trying 'C:\Projects\src\.npmrc'...not found.
Using package manager: 'npm'
Collecting installed dependencies...
Found 40 dependencies.
"next" option has no effect when using "migrate-only" option.
** Executing migrations of package '@angular/cli' **

>  Update an Angular CLI project to version 9.
Invalid JSON character: "{" at 74:32.
×  Migration failed. See above for further details.

🌍 Your Environment


Angular CLI: 9.0.0-rc.0
Node: 10.16.3
OS: win32 x64
Angular: 9.0.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.900.0-rc.0
@angular-devkit/build-angular      0.900.0-rc.0
@angular-devkit/build-optimizer    0.900.0-rc.0
@angular-devkit/build-webpack      0.900.0-rc.0
@angular-devkit/core               9.0.0-rc.0
@angular-devkit/schematics         9.0.0-rc.0
@angular/cdk                       8.2.3
@angular/material                  8.2.3
@angular/material-moment-adapter   8.2.3
@ngtools/webpack                   9.0.0-rc.0
@schematics/angular                9.0.0-rc.0
@schematics/update                 0.900.0-rc.0
rxjs                               6.5.3
typescript                         3.6.4
webpack                            4.41.2

Anything else relevant?

I just found the main fail point of this migration.

Here is my angular.json snippet:

        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/luxshare-ict-oms",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/web.config"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "dev": {
              "fileReplacements": [{
                "replace": "src/environments/environment.ts",
                "with": "src/environments/environment.dev.ts"
              }],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true
            },
            "production": {
              "fileReplacements": [{
                "replace": "src/environments/environment.ts",
                "with": "src/environments/environment.prod.ts"
              }],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [{
                "type": "initial",
                "maximumWarning": "2mb",
                "maximumError": "5mb"
              }]
            }
          }
        },

The main problem is on the "budgets" section. If I just simply re-format this into this:

        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/luxshare-ict-oms",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/web.config"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "dev": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.dev.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true
            },
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            }
          }
        },

Then it just works.

@doggy8088 doggy8088 changed the title ng update @angular/cli @angular/core --next failed ng update @angular/cli --next failed Nov 4, 2019
@alan-agius4 alan-agius4 added area: @schematics/angular needs: more info Reporter must clarify the issue labels Nov 4, 2019
@ngbot ngbot bot modified the milestone: needsTriage Nov 4, 2019
@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix and removed needs: more info Reporter must clarify the issue labels Nov 4, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Nov 4, 2019
@alan-agius4
Copy link
Collaborator

Duplicate of #15462

@alan-agius4 alan-agius4 marked this as a duplicate of #15462 Nov 4, 2019
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

No branches or pull requests

2 participants