vega icon indicating copy to clipboard operation
vega copied to clipboard

Got Error While creating new component

Open dani32112 opened this issue 7 years ago • 8 comments

# 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 directorystructure

dani32112 avatar Jul 07 '17 07:07 dani32112

same here....

muyiwa avatar Jul 08 '17 15:07 muyiwa

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 :)

gabra666 avatar Jul 08 '17 17:07 gabra666

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

dani32112 avatar Jul 08 '17 18:07 dani32112

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

  1. rename app.module.client.ts to app.client.module.ts
  2. open this file and replace the declarations : sharedConfig.declarations with declarations : [...sharedConfig.declarations]
  3. Modify the reference to this file in boot-client.ts - import { AppModule} from './app/app.client.module';

Let me know if this works.

gabra666 avatar Jul 08 '17 18:07 gabra666

gabra666 bro this directory path'./app/app.client.module'; is not working giving error.

dani32112 avatar Jul 08 '17 19:07 dani32112

gabra666 bro! its still giving the same error

dani32112 avatar Jul 08 '17 19:07 dani32112

Thanks a lot bro its working fine i misspelled little

dani32112 avatar Jul 08 '17 19:07 dani32112

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.

dani32112 avatar Jul 08 '17 19:07 dani32112