nativescript-schematics icon indicating copy to clipboard operation
nativescript-schematics copied to clipboard

ERROR in error TS6053: main.ts not found.

Open cyluxx opened this issue 6 years ago • 2 comments

Describe the bug I tried to migrate an Angular web project, but when I ng serve the application, I get the following error: ERROR in error TS6053: File '-path-to-project-/what-the-song/src/src/main.ts' not found. error TS6053: File '-path-to-project-/what-the-song/src/src/polyfills.ts' not found.

Clearly, the path is not correct! There is an unnecessary src. The debug option -o does not print more information. Am I doing something wrong or is this a bug? I don't know where to look at to fix the path.

To Reproduce I followed the instructions on the migration documentation.

  1. installed nativeScript CLI
  2. upgraded angular CLI
  3. added schematics to the project with ng add @nativescript/schematics
  4. ng serve to test if the web project works

Environment after schematics install

{
  "name": "what-the-song",
  "version": "0.0.0",
  "scripts": {
    "android": "tns run android",
    "ios": "tns run ios",
    "mobile": "tns run",
    "preview": "tns preview",
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "nativescript-angular": "~8.0.1",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.12",
    "tns-core-modules": "~6.0.0",
    "@angular/animations": "^7.2.15",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/fire": "^5.2.1",
    "@angular/forms": "^7.2.15",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "@fortawesome/angular-fontawesome": "^0.3.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.21",
    "@fortawesome/free-brands-svg-icons": "^5.10.1",
    "@fortawesome/free-solid-svg-icons": "^5.10.1",
    "@nativescript/schematics": "^0.7.0",
    "bootstrap-material-design": "^4.1.2",
    "core-js": "^2.5.4",
    "firebase": "^5.11.1",
    "mic-recorder-to-mp3": "^2.2.1",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "nativescript-dev-webpack": "~1.0.0",
    "@nativescript/schematics": "~0.7.0",
    "@nativescript/tslint-rules": "~0.0.2",
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.8",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@types/node": "~8.9.4",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.2.2"
  },
  "nativescript": {
    "id": "org.nativescript.ngsample"
  }
}

cyluxx avatar Aug 16 '19 08:08 cyluxx

I had the same problem. I solved it going into tsconfig.app.json and changing the path under the file section to: image It orginally had src/ in front of it and somewhere else it already adds this src/. Also have a look at this stackoverflow post: https://stackoverflow.com/questions/49091956/angular5-polyfills-ts-main-ts-is-missing-from-the-typescript-compilation

TimvdLooy avatar Sep 19 '19 11:09 TimvdLooy

Thank you @TimvdLooy, it worked for me.

rldarshan avatar Aug 28 '20 09:08 rldarshan