1

Added nativescripts to exisiting Angular Application using this npm install --global @nativescript/schematics and ng add @nativescript/schematics

Got below 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.

then i have followed this link to resolve it https://stackoverflow.com/a/58623108/14326477

but then again got below different error, Attached the screen shot below

Image attached here. Error while building

ERROR in ./src/app/components/refund/refund.module.ts Module build failed (from ./node_modules/@ngtools/webpack/src/index.js): Error: C:\Users[path]\Client\src\app\components\refund\refund.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. at AngularCompilerPlugin.getCompiledFile (C:\Users[path][\Client\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:752:23) at plugin.done.then (C:\Users[path]\Client\node_modules@ngtools\webpack\src\loader.js:41:31) at process._tickCallback (internal/process/next_tick.js:68:7)

Can you guys please help on this?

  • is `refund.module.ts` a lazy loaded module? – Andrei Feb 19 '21 at 13:32
  • Yes. We are using lazyload module. { path: 'refund', loadChildren: './components/refund/refund.module#RefundModule', canActivate: [AuthGuard] }, – SIVAMUTHUKUMAR SELLAM Feb 19 '21 at 16:27
  • could you provide your package.json (libs versions are important) and file, where you are importing this refund module – Andrei Feb 19 '21 at 17:37
  • Hi Andrei, this is the package.json https://github.com/shivaupdate/SampleShare/blob/main/package.json and module is imported to app-routing.module.ts through routes array and then app-routing.module.ts is imported to app.module.ts – SIVAMUTHUKUMAR SELLAM Feb 19 '21 at 21:19
  • you could provide this file in the question body. Do you have old style angular imports of lazy modules like this `loadchildren: './path/to/module.ts#MyModule'` ? or modern ones – Andrei Feb 19 '21 at 22:12
  • { path: 'refund', loadChildren: './components/refund/refund.module#RefundModule', canActivate: [AuthGuard] } Andrei, we are using like this – SIVAMUTHUKUMAR SELLAM Feb 19 '21 at 22:29
  • it seems nativescript build does not autodetect lazy loading modules. is it possible to update your angular to at least version 9 and use import(...) syntax for lazy loading modules? – Andrei Feb 19 '21 at 23:30
  • Thanks Andrei. You are right. Will try upgrade my appln before move into native scripts. – SIVAMUTHUKUMAR SELLAM Mar 01 '21 at 00:03
  • Hi, After upgrade to angular 9, tried to add nativescript schematics(ng add @nativescript/schematics), i got this below error, "Failed to find generated component file /auto-generated.component.css. Please contact the @nativescript/schematics author." @Andrei, Any idea on this – SIVAMUTHUKUMAR SELLAM Mar 11 '21 at 21:24
  • Attached Package.json and angular.json, please correct if any thing wrong. https://github.com/shivaupdate/SampleShare/blob/main/package%20(2).json https://github.com/shivaupdate/SampleShare/blob/main/angular.json – SIVAMUTHUKUMAR SELLAM Mar 11 '21 at 21:41

0 Answers0