angular-npm-module-seed icon indicating copy to clipboard operation
angular-npm-module-seed copied to clipboard

Unexpected value 'SeedModule' imported by the module 'AppModule'. Please add a @NgModule annotation.

Open ghost opened this issue 8 years ago • 2 comments

I followed all the steps you described, up to npm link from dist folder and npm link angular-npm-module-seed in the root folder of the project where I want to use my custom component. Linking seems to work fine as I see the code inside npm_modules.

After that I imported the SeedModule inside my test app's AppModule (which uses Angular 4). However I can't run my application anymore. The browser console logs the following error: Unexpected value 'SeedModule' imported by the module 'AppModule'. Please add a @NgModule annotation.

Any idea?

ghost avatar Aug 08 '17 11:08 ghost

I think this issue is related to an update of node or npm. Previously when searching for dependencies it would treat symlinked files as though they were in the linked location but new versions search upwards from the source location for node_modules.

This tripped me up for a long time too but I found this thread with some workarounds (linked directly to most relevant comment): https://github.com/angular/angular/issues/15763#issuecomment-315729709

OutlierFinance avatar Aug 28 '17 13:08 OutlierFinance

I'm having the same issue. I filed an issue here https://github.com/filipesilva/angular-quickstart-lib/issues/55

playground avatar Aug 28 '17 13:08 playground