-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected value 'TickTockModule' imported by the module 'Feature1RoutingModule'. Please add a @NgModule annotation #8
Comments
I temporally fixed this deleting the node-modules/angular-library-seed/node-modules Of course, you need to do this every time you build your library. So if you are in your angular-cli generated project you can run:
And this will allow you to test your library with your angular-cli generated project But if you do this, and you want to re-build your library you will have to install and build again with
|
@leomendoza123 have you tried to specify |
@trekhleb I did that (as pointed out in the issue description), and the error generates afterwards. |
@trekhleb I did and that allows me to compile, but as @unsafecode describes, I am now getting this error when I load the angular-cli app on the browser:
|
@leomendoza123 does it happen only when lazy-loading used? I'm using
and all looks fine, but not yet using my lib in lazy-loaded module. |
There's any update about this error? I added the "path" described in the previous comment, but I still having the same error about the '@NgModule annotation' |
@trekhleb any upcoming fix of this error ? |
@unsafecode , @qasimraza1979 , @dannyTorres Currently I may speak only about workarounds:
Other than that I may suggest you to use custom Angular starter (like the one in demo folder of the project) instead of Angular CLI but this of course may not be the case because of Angular CLI popularity. But again, I understand that all of the above are just workarounds and not solutions. Once I come up with one I'll post it here. |
Thanks for the workaround. |
On Angular-CLI I "solved" this problem using Not sure if it's the good solution, what do you think? |
@lpalli thank you for your suggestion but unfortunately running But running |
Description
I'm facing this error when trying to import
TickTockModule
in a Angular CLI project, via a lazy-loaded module:Unexpected value 'TickTockModule' imported by the module 'Feature1RoutingModule'. Please add a @NgModule annotation
(happens when I navigate the lazy route)Feature1RoutingModule
was created via CLI and is defined as follows:Where
@unsafecode/feature1
is the library package, cloned from this repo and linked withnpm link
(no changes).I also checked the Angular CLI project
tsconfig.json
has thepaths: {...}
options configured as described.Configuration
[email protected]
[email protected]
@angular/[email protected]
The text was updated successfully, but these errors were encountered: