Skip to content

Error while upgrading to v10 #18012

@himanshugarg574

Description

@himanshugarg574

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No.

Yes, the previous version in which this bug was not present was: ....

Description

I did all pre-update steps as specified on update.angular.io. After which I ran ng update @angular/cli @angular/core. It bails out with an error. I performed the migration with ng update @angular/cli --migrate-only --from 9 --to 10, which fails with same errors.

A clear and concise description of the problem...

🔬 Minimal Reproduction

🔥 Exception or Error




[error] Error: Unexpected end of file.
    at _readValue (D:\Development\upgrade\node_modules\@angular-devkit\core\src\json\parser.js:625:19)
    at Object.parseJsonAst (D:\Development\upgrade\node_modules\@angular-devkit\core\src\json\parser.js:722:17)
    at visitExtendedJsonFiles (D:\Development\upgrade\node_modules\@schematics\angular\migrations\update-10\solution-style-tsconfig.js:30:32)
    at visitExtendedJsonFiles.next ()
    at visitExtendedJsonFiles (D:\Development\upgrade\node_modules\@schematics\angular\migrations\update-10\solution-style-tsconfig.js:45:16)
    at visitExtendedJsonFiles.next ()
    at visitExtendedJsonFiles (D:\Development\upgrade\node_modules\@schematics\angular\migrations\update-10\solution-style-tsconfig.js:45:16)
    at visitExtendedJsonFiles.next ()
    at visitExtendedJsonFiles (D:\Development\upgrade\node_modules\@schematics\angular\migrations\update-10\solution-style-tsconfig.js:45:16)
    at visitExtendedJsonFiles.next ()
    at D:\Development\upgrade\node_modules\@schematics\angular\migrations\update-10\solution-style-tsconfig.js:56:45
    at MergeMapSubscriber.project (D:\Development\upgrade\node_modules\@angular-devkit\schematics\src\rules\call.js:75:24)
    at MergeMapSubscriber._tryNext (D:\Development\upgrade\node_modules\rxjs\internal\operators\mergeMap.js:69:27)
    at MergeMapSubscriber._next (D:\Development\upgrade\node_modules\rxjs\internal\operators\mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (D:\Development\upgrade\node_modules\rxjs\internal\Subscriber.js:66:18)
    at Observable._subscribe (D:\Development\upgrade\node_modules\rxjs\internal\util\subscribeToArray.js:5:20)
    at Observable._trySubscribe (D:\Development\upgrade\node_modules\rxjs\internal\Observable.js:44:25)
    at Observable.subscribe (D:\Development\upgrade\node_modules\rxjs\internal\Observable.js:30:22)
    at MergeMapOperator.call (D:\Development\upgrade\node_modules\rxjs\internal\operators\mergeMap.js:39:23)
    at Observable.subscribe (D:\Development\upgrade\node_modules\rxjs\internal\Observable.js:25:31)
    at Object.subscribeToResult (D:\Development\upgrade\node_modules\rxjs\internal\util\subscribeToResult.js:12:23)
    at MergeMapSubscriber._innerSub (D:\Development\upgrade\node_modules\rxjs\internal\operators\mergeMap.js:82:53)

🌍 Your Environment

before running upgrade




Angular CLI: 9.1.9
Node: 12.3.1
OS: win32 x64

Angular: 9.1.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.901.9
@angular-devkit/build-angular      0.901.9
@angular-devkit/build-optimizer    0.901.9
@angular-devkit/build-webpack      0.901.9
@angular-devkit/core               9.1.9
@angular-devkit/schematics         9.1.9
@angular/cdk                       9.2.4
@angular/cli                       9.1.9
@angular/material                  9.2.4
@angular/material-moment-adapter   9.2.4
@ngtools/webpack                   9.1.9
@schematics/angular                9.1.9
@schematics/update                 0.901.9
rxjs                               6.5.5
typescript                         3.8.3
webpack                            4.42.0

Anything else relevant?

angular.json


{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "RMS": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "rms",
      "schematics": {
        "@ngrx/schematics:component": {
          "styleext": "scss",
          "changeDetection": "OnPush"
        }
      },
      "architect": {
        "build": {
          "builder": "@angular-builders/custom-webpack:browser",
          "options": {
            "baseHref": "/rms/dist/",
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "aot": true,
            "assets": ["src/favicon.ico", "src/assets"],
            "styles": ["src/styles.scss", "src/print-template.scss"],
            "stylePreprocessorOptions": {
              "includePaths": ["node_modules/bootstrap/scss"]
            },
            "scripts": [
              "node_modules/jquery/dist/jquery.slim.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js",
              "src/assets/js/blowfish.js"
            ],
            "customWebpackConfig": {
              "path": "./utils/webpack.config.js"
            }
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ],
              "serviceWorker": true,
              "ngswConfigPath": "ngsw-config.json"
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "RMS:build",
            "proxyConfig": "proxy.conf.json"
          },
          "configurations": {
            "production": {
              "browserTarget": "RMS:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "RMS:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": ["src/styles.scss", "src/print-template.scss"],
            "scripts": [
              "node_modules/jquery/dist/jquery.min.js",
              "node_modules/popper.js/dist/umd/popper.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js"
            ],
            "assets": ["src/favicon.ico", "src/assets", "src/manifest.webmanifest"],
            "stylePreprocessorOptions": {
              "includePaths": ["node_modules/bootstrap/scss"]
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
            "exclude": ["**/node_modules/**"]
          }
        }
      }
    },
    "RMS-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "prefix": "",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "RMS:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "RMS:serve:production"
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": "e2e/tsconfig.e2e.json",
            "exclude": ["**/node_modules/**"]
          }
        }
      }
    }
  },
  "defaultProject": "RMS",
  "cli": {
    "defaultCollection": "@ngrx/schematics"
  }
}

tsconfig.json


{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "esnext",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "resolveJsonModule": true,
    "target": "ES2018",
    "typeRoots": ["node_modules/@types"],
    "lib": ["es2018", "dom", "ES2019.Array"],
    "paths": {
      "@app/*": ["src/app/*"],
      "@env/*": ["src/environments/*"]
    }
  },
  "angularCompilerOptions": {
    "strictTemplates": true
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions