angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Invalid JSON character: "<" at 57:52. Error: Invalid JSON character: "<" at 57:52.

Open javascriptsoldier opened this issue 8 years ago • 5 comments

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

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

Versions

Angular CLI: 6.1.3 Node: 8.11.3 OS: linux x64 Package Version

@angular-devkit/architect 0.6.8 @angular-devkit/build-angular 0.6.8 @angular-devkit/build-optimizer 0.6.8 @angular-devkit/core 0.6.8 @angular-devkit/schematics 0.7.3 @angular/cdk 6.4.3 @angular/cli 6.1.3 @angular/material 6.4.3 @ngtools/webpack 6.0.8 @schematics/angular 0.7.3 @schematics/update 0.7.3 rxjs 6.2.2 typescript 2.7.2 webpack 4.8.3

Repro steps

I'm using angular CLI 6.0.8 from last 3 months, it's working fine up to today, I haven't installed or updated any npm modules, suddenly my code started issue as below, to fix i try updating new version of CLI, then I removed all the node modules and reinstalled, but the issue is not fixed can anyone help me on this, I am not able to identify from the where the issue is from, I believe the issue is from the angular library( dev dependencies), issue as blow

Invalid JSON character: "<" at 57:52. Error: Invalid JSON character: "<" at 57:52. at _readValue (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:565:19) at _readArray (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:321:22) at _readValue (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:559:22) at _readProperty (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:398:19) at _readObject (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:431:30) at _readValue (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:562:22) at _readProperty (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:398:19) at _readObject (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:431:30) at _readValue (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:562:22) at _readProperty (/home/anilkumar/Anil_Kumar_Dyavanapalli/SDN/Buzzybooth/Buzzybooth/frontend/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:398:19)

The log given by the failure

Desired functionality

Mention any other details that might be useful

javascriptsoldier avatar Aug 11 '18 09:08 javascriptsoldier

I am not sure if it will fix your problem or not but can you try to align the versions of your packages? You have some which are 0.7.3 and some are 0.6.8. Can you update everything to 0.7.3 and see if the problem persists? Otherwise can you check if your angular.json has an error at that position?

alan-agius4 avatar Aug 11 '18 11:08 alan-agius4

@javascriptsoldier i've had similar exception. for my case it's tsconfig.json has invalid syntax where i've had extra comma in the array value ['somevalue',]. i've used this trick to uncover the error-ed json. edit parse.js and add console.log(input) in parseJsonAst() function as below, then run again your command and you should see the json that it's tried to parse.

function parseJsonAst(input, mode = JsonParseMode.Default) { console.log(input)

laiseng avatar Sep 12 '18 14:09 laiseng

Closing an no further info provided.

If the problem persists please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

alan-agius4 avatar Sep 14 '18 12:09 alan-agius4

Sorry my bad, one of my co-developer pushed the code without resolving merge issue, that's given me the error

javascriptsoldier avatar Dec 18 '18 05:12 javascriptsoldier

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.