-
-
Notifications
You must be signed in to change notification settings - Fork 40
Error Module not found: Error: Can't resolve './app.module.ngfactory' #233
Comments
Suddenly got this error too since today, our CI build started failing without changing anything regarding dependencies. |
The issue seems to be within the "webpack" package. If I go to node_modules/webpack/package.json and remove all the ^ and ~ from the dependencies and reinstall the webpack/node_modules folder, the build works again... |
@jibon57 see the comment above |
It's not a sustainable solution for our build server though. Would like to dig up the package that's screwing things up and get a good fix for it. |
I was having another issue with webpack which got resolved by removing the ^ and ~ from the dependencies but now I'm having this issue I posted. I think it has to do with the fact that the project was created before NS having AOT. I manually added the main.aot.ts file but im getting this error. |
I'm also getting this error, so I tried to reproduce it with a new project, which I created with EDIT: Found which module was causing the issue. The new version of enhanced-resolve came out about 11 hours ago, just install version 3.3.0 and this issue will be solved while a bugfix comes out. Related issue: webpack/enhanced-resolve#98 |
I'm also getting this error. |
Updating |
Setting exact version for enhanced-resolve( |
None of the solutions posted here have worked for me. I also tried doing what is suggested in these issues: nativescript-dev-webpack/issues/75, nativescript-dev-webpack/issues/36 , but no luck |
When I followed the second comment in this issue: nativescript-dev-webpack/issues/36, im getting this error:
|
The error I just posted helped me determine that I had to have a module id on my components and had to change the paths of the templateUrls and styleUrl to a relative path. Just like the answer in this stackoverflow post: ngc-looking-in-wrong-directory |
Hi @joey0xx , |
Hi, Now when I run, npm run start-android-bundle, I get the following error: ERROR in Could not resolve module @ angular/core ERROR in ./main.aot.ts npm ERR! Windows_NT 10.0.14393 npm ERR! Please include the following file with any support request: npm ERR! Windows_NT 10.0.14393 npm ERR! Please include the following file with any support request: Also, in my code I find that the ts file gives me an error saying "cannot find module @angular/core". Similar errors are occuring for "ui/page" and "rxjs/Rx" I have done the following things to fix this problem with no success -
Please suggest what I could to try and make webpack work in my project. |
npm i [email protected] should solve the problem. |
@iguissouma , I have tried it but still no luck :(
|
@jibon57 can you include your app.module.ts, it seems that something is not supported with aot compilation? |
app.module.ts
routing.ts
Error:
|
@jibon57 try to use string-based routes like loadChildren: Or I think you should extract the loadChildren in a function so the aot compilation can work: |
@iguissouma Thanks but I am getting this error now:
|
Did you use the literal string or function? Your problem is not the same it's related to lazy loading and aot compilation, Try to open a new issue. |
@iguissouma Thanks for your help. I have opened a new issue here: #249 .. Please help me to resolve this issue. |
Hi, im getting the following error when running webpack in my project:
The text was updated successfully, but these errors were encountered: