Skip to content

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

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
javascriptsoldier opened this issue Aug 11, 2018 · 5 comments
Labels
needs: more info Reporter must clarify the issue

Comments

@javascriptsoldier
Copy link

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

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Aug 11, 2018

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?

@alexeagle alexeagle added the needs: more info Reporter must clarify the issue label Aug 13, 2018
@laiseng
Copy link

laiseng commented Sep 12, 2018

@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)

@alan-agius4
Copy link
Collaborator

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.

@javascriptsoldier
Copy link
Author

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

@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 Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests

4 participants