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
在同一问题上有不同的错误位置:
[Error - 11:28:36] Notification handler 'textDocument/didOpen' failed with message: Unexpected token } in JSON at position 534
编辑
我正在使用以下版本:
角度:5.2.0
打字稿:2.5.3
VSCode:1.19.2
我想,我设法找到了根本原因。 这不是插件或语言服务中的错误! tsconfig.json蜂格式不正确是一个问题。
我的tsconfig.json看起来像这样:
"angularCompilerOptions": {
"fullTemplateTypeCheck": true , //<-------- This comma did cause the issue
}
删除逗号后,该插件运行良好。
@ tkoenig89 ,作为此问题的创建者,谨请您允许其他人测试此解决方案,然后再建议他们关闭它,因为您发现了对您有用的东西👍
@ markgoho-EDT我想你是对的,我对此可能有点太快了。 可能是因为我为这个问题所困扰,并且当我终于设法找到解决方案时感到非常高兴:)
更新:我们在tsconfig.json
行的结尾处也有一个多余的逗号
在这里:
...
"pretty": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
},
在noUnusedParamters
。
@chuckjaz希望这会
我也有同样的问题。 我在我的角度项目中的所有json文件上运行了jslint。 事实证明,导致问题的angular.json
文件中有一个小逗号。 删除该固定的一切。 如果有人需要,请将其留在这里。 找到了关于stackoverflow问题和此线程的解决方案。
最有用的评论
我想,我设法找到了根本原因。 这不是插件或语言服务中的错误! tsconfig.json蜂格式不正确是一个问题。
我的tsconfig.json看起来像这样:
删除逗号后,该插件运行良好。