Search code examples
angulartypescriptnativescript

"Can't parse tsconfig.json file" error when converting Angular 10 project to nativescript shared project


I updated an Angular 8 project first to Angular 9 then Angular 10. After successfully updating to 10 and running ng serve to make sure the application still correctly works I followed the nativescript migration steps here.

When getting to the step where I add @nativescript/schematics I get the following error "File tsconfig.json could not be parsed!".

I saw this stackoverflow question and plugged my tsconfig.json into the compiler and still couldn't figure out what was causing the error. All brackets seem to be closed directly.

Any help on this is greatly appreciated! Below is the code in my tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ],
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

Solution

  • Ended up being the , after the single "lib" array. Was solely a JSON issue and not anything with the angular / nativescript migration.

    Hope this helps someone else that ran into this simple but goofy error. cheers!