1

I had a working angular project, and wanted to try NativeScript, so I added NativeScript to it using npm install --global @nativescript/schematics and ng add @nativescript/schematics but now when I try to run ng serve I get this error

ERROR in error TS6053: File 'C:[path]/src/src/main.ts' not found.

error TS6053: File 'C:[path]/src/src/polyfills.ts' not found.

I tried deleting node_modlues, and running npm install again, but the error is the same. I even tried restarting my terminal and run ng serve again and the result is the same

Did I do something wrong? Or did i forget to do something?

EDIT

tsconfig.app.json file:

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "types": [],
    "paths": {
      "@src/*": [
        "src/*.web",
        "src/*"
      ]
    }
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ],
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ]
}

3 Answers 3

1

Remove the keyword 'src/' from the paths mentioned in the files array and try. checkout this - https://github.com/NativeScript/nativescript-schematics/issues/240 Hope this helps.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, both the web and mobile app work now. Happy coding ;)
1

It seems as a problem with paths or files properties inside tsconfig.app.json. Can you paste it here to check if this is the case?

Comments

0

Another way to fix this is to change the location of main file inside angular.json -> "main": "src/main.ts"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.