Skip to content

Error while upgrading to v10 #18012

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
1 of 15 tasks
himanshugarg574 opened this issue Jun 25, 2020 · 2 comments · Fixed by #18015
Closed
1 of 15 tasks

Error while upgrading to v10 #18012

himanshugarg574 opened this issue Jun 25, 2020 · 2 comments · Fixed by #18015
Assignees
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@himanshugarg574
Copy link

himanshugarg574 commented Jun 25, 2020

🐞 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
  }
}
@bjornharvold
Copy link

I am having the same issue. It occurs during this phase:

❯ Add "Solution Style" TypeScript configuration file support.
  This improves developer experience using editors powered by TypeScript’s language server.
  Read more about this here: https://v10.angular.io/guide/migration-solution-style-tsconfig
✖ Migration failed: Unexpected end of file.
  See "/private/var/folders/h4/cgdfqbfx61s5r8kc3lpx119h0000gn/T/ng-oKUAoz/angular-errors.log" for further details.

@ngbot ngbot bot added this to the needsTriage milestone Jun 25, 2020
@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely type: bug/fix labels Jun 25, 2020
@alan-agius4 alan-agius4 self-assigned this Jun 25, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jun 25, 2020
filipesilva pushed a commit that referenced this issue Jun 26, 2020
…migrations

During the solution-style-tsconfig migration we are unexpectedly erroring out when encounter a blank JSON file. This PR fixes this behaviour and also prints the file path when an error occurs when parsing JSON contents.

Closes: #18012
filipesilva pushed a commit that referenced this issue Jun 26, 2020
…migrations

During the solution-style-tsconfig migration we are unexpectedly erroring out when encounter a blank JSON file. This PR fixes this behaviour and also prints the file path when an error occurs when parsing JSON contents.

Closes: #18012
villelahdenvuo pushed a commit to villelahdenvuo/angular-cli that referenced this issue Jul 6, 2020
…migrations

During the solution-style-tsconfig migration we are unexpectedly erroring out when encounter a blank JSON file. This PR fixes this behaviour and also prints the file path when an error occurs when parsing JSON contents.

Closes: angular#18012
@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 Jul 27, 2020
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

Successfully merging a pull request may close this issue.

3 participants