vega
vega copied to clipboard
Got Error While creating new component
# Need Help To Solve
i got an error while creating a new component using ng g component
D:\Myapp\ClientApp\app\components>ng g component newform
installing component
Error locating module for declaration
SilentError: No module files found
same here....
Hi, this is a common error while using the newest yeoman generator for dot net core angular SPA, you can find some solutions in this thread:
https://www.udemy.com/aspnet-core-angular/learn/v4/questions/2334464
check my answer I hope it helps :)
Thanks gabra666 for your response will you please elaborate the answer here i don't have access to this course i am just searching for solution and paste my issue here kindly help me out
Hi the problem you hare having is because the Angular CLI expects to find a file that follows this convention X.module.ts - but you have 3 modules there, and neither of these follow that convention (app.module.client.ts, app.module.server.ts and app.module.shared.ts) I think this was a decision to separate angular client and server dependencies.
The solution I found is just 3 steps
- rename app.module.client.ts to app.client.module.ts
- open this file and replace the declarations : sharedConfig.declarations with declarations : [...sharedConfig.declarations]
- Modify the reference to this file in boot-client.ts - import { AppModule} from './app/app.client.module';
Let me know if this works.
gabra666 bro this directory path'./app/app.client.module'; is not working giving error.
gabra666 bro! its still giving the same error
Thanks a lot bro its working fine i misspelled little
gabra666 bro if you don't mind can you send me your email or any other source so i can take your help if i need because i new to learn this technology i shall be very thankful to you.