TypeScript error TS5014: Unexpected token u in JSON at position 0

后端 未结 6 963
南方客
南方客 2021-01-07 19:11

I am trying to compile a .ts to .js

I have tsconfig.json as below

{
\"compilerOptions\": {
    \"target\": \"es5\",
    \"module\": \"co         


        
6条回答
  •  情书的邮戳
    2021-01-07 19:33

    There could be a bunch of things that can go wrong when saving a file that would prevent correct parsing. I usually elect to not deal with it by renaming the file to tsconfig.json.backup or something, then invoking tsc --init to generate a known good file. You can then transfer your specific configuration into the newly generated tsconfig.json file, uncommenting the parts you care about.

    If it persists after that, it could be an actual bug in the TypeScript version you're on.

提交回复
热议问题