Skip to content

ng update v10 fails with Invalid JSON character: "\\" at 3:71.Β #18053

Closed
@jorgjanke

Description

@jorgjanke

🐞 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?

ng update # to version 10.0.0

❯ 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: Invalid JSON character: "\\" at 3:71.
  See "/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/ng-1w8vHv/angular-errors.log" for further details.

I updated a simple repository without problems, This is in a more complex repository

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

n/a

Description

A clear and concise description of the problem...
  • trying to upgrade from cli version 9.1.7 to 10.0.0
  • fails when converting tsconfig.json
  • searched in repository for \ - but only found one in tslint.json - removing the option did not fix the issue
  • after that no *.json contained "\" or even "" (running on Mac)
  • after the issue, the repository needed to be rolled back

πŸ”¬ Minimal Reproduction

Was not able to replicate the issue outside this (private) repository.

πŸ”₯ Exception or Error




❯ 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: Invalid JSON character: "\\" at 3:71.
  See "/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/ng-1w8vHv/angular-errors.log" for further details.

[error] Error: Invalid JSON character: "\\" at 3:71.
    at _readString (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@angular-devkit/core/src/json/parser.js:306:19)
    at _readValue (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@angular-devkit/core/src/json/parser.js:648:22)
    at _readProperty (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@angular-devkit/core/src/json/parser.js:492:19)
    at _readObject (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@angular-devkit/core/src/json/parser.js:525:30)
    at _readValue (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@angular-devkit/core/src/json/parser.js:675:22)
    at Object.parseJsonAst (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@angular-devkit/core/src/json/parser.js:722:17)
    at visitExtendedJsonFiles (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@schematics/angular/migrations/update-10/solution-style-tsconfig.js:30:32)
    at visitExtendedJsonFiles.next ()
    at /private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@schematics/angular/migrations/update-10/solution-style-tsconfig.js:56:45
    at MergeMapSubscriber.project (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/@angular-devkit/schematics/src/rules/call.js:75:24)
    at MergeMapSubscriber._tryNext (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
    at MergeMapSubscriber._next (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Observable._subscribe (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/rxjs/internal/util/subscribeToArray.js:5:20)
    at Observable._trySubscribe (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/private/var/folders/1l/9rd7xh7j3pj6078gw3ptvq_h0000gn/T/angular-cli-packages-5CGffu/node_modules/rxjs/internal/Observable.js:30:22)

🌍 Your Environment

(before)




Your global Angular CLI version (10.0.0) is greater than your local
version (9.1.9). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.1.9
Node: 12.16.1
OS: darwin x64

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

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.901.9
@angular-devkit/build-angular      0.901.9
@angular-devkit/build-ng-packagr   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/cli                       9.1.9
@ngtools/webpack                   9.1.9
@schematics/angular                9.1.9
@schematics/update                 0.901.9
ng-packagr                         9.1.5
rxjs                               6.5.5
typescript                         3.8.3
webpack                            4.42.0

Anything else relevant?

Mac - latest versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions