Search path: c:/Users/Nella/Documents/EDT/app-copa/src/app
Config file name: c:/Users/Nella/Documents/EDT/app-copa/tsconfig.json
SERVER ERROR: Unexpected token } in JSON at position 823
SyntaxError: Unexpected token } in JSON at position 823
at JSON.parse (<anonymous>)
at parseAndReEmitConfigJSONFile (C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\editorServices.js:257:33)
at ProjectService.configFileToProjectOptions (C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\editorServices.js:1598:18)
at ProjectService.openConfigFile (C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\editorServices.js:1620:42)
at ProjectService.openOrUpdateConfiguredProjectForFile (C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\editorServices.js:1486:41)
at ProjectService.openClientFile (C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\editorServices.js:1404:23)
at C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\documents.js:135:47
at TextDocuments.logErrors (C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\documents.js:235:13)
at C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\documents.js:131:74
at handleNotification (C:\Users\Nella\.vscode-insiders\extensions\Angular.ng-template-0.1.7\server\node_modules\vscode-jsonrpc\lib\main.js:353:21)
[Error - 10:05:39 PM] Notification handler 'textDocument/didOpen' failed with message: Unexpected token } in JSON at position 823
+1
[Error - 23:16:59] Notification handler 'textDocument/didOpen' failed with message: Unexpected token } in JSON at position 515
Having the same issue with a different error position:
[Error - 11:28:36] Notification handler 'textDocument/didOpen' failed with message: Unexpected token } in JSON at position 534
Edit
I'm using following versions:
Angular: 5.2.0
Typescript: 2.5.3
VSCode: 1.19.2
I guess, i managed to find the root cause. It's not a bug in the plugin or the language service! It's an issue with the tsconfig.json beeing not formated correctly.
My tsconfig.json looked like this:
"angularCompilerOptions": {
"fullTemplateTypeCheck": true , //<-------- This comma did cause the issue
}
After removing the comma, the plugin worked well.
@tkoenig89 respectfully, as the creator of this issue, please allow for others to test this solution before suggesting that they close it because you found something that worked for you 馃憤
@markgoho-EDT i guess you are right, i might have been a little too quick about this. Might be because i was bothered by the issue, and too happy when i finally managed to find a solution :)
Update: we also had an extraneous comma at the end of a line in our tsconfig.json
it was here:
...
"pretty": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
},
after noUnusedParamters.
@chuckjaz hopefully this helps. I won't close this bug because this should probably solved by a different method of error handling rather than a user removing a comma.
I too had the same problem. I ran jslint on all json files in my angular project. And it turns out that there was a small comma in angular.json file that caused the issue. Removing that fixed everything. Leaving it here in case someone needs it. Found the solution on stackoverflow question and this thread.
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._
Most helpful comment
I guess, i managed to find the root cause. It's not a bug in the plugin or the language service! It's an issue with the tsconfig.json beeing not formated correctly.
My tsconfig.json looked like this:
After removing the comma, the plugin worked well.