-
Notifications
You must be signed in to change notification settings - Fork 12k
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
ERROR in [module] is not an NgModule #7384
Comments
I've yet to fully grasp the expected package format of a compiled angular library, but looking at the root metadata.json of other projects (i.e. Angular Material 2), it looks like its where the decorator information ends up. And this seems missing in the libraries where the imports cause issues. |
@n0daft — Can you please try:
and see if that helps? See jvandemo/generator-angular2-library#170 (comment). |
@jvandemo: thanks for helping. I updated @angular/cli to 1.3.0 in order to use the
You think it has something todo with symlinks? I've read that in v5 npm makes use of symlinks instead of making copies into the node_modules folder of the consuming project. But as far as I can tell I'm still using npm v4.2.0. |
It seems that only modules of the Content of
Already the part |
I just found the cause for the suspicious looking
The index.ts files contain the needed exports from their level respectively. However, everything that is not inside the root level is lacking in the |
I was able to fix the issue. It really was the incomplete metadata.json file which caused the error. We had to change our barrel files accordingly: Change
to
There were some discussions regarding angular2 and barrels (angular/angular.io#1301). However, I'm not sure which conclusions I should draw from them. In any case, this issue is resolved. |
@n0daft — Thank you for the update. Did you still need
to avoid the error? |
@jvandemo We got the error when we where consuming the library in a different project from the official npm repo. Symlink issues are AFAIK only relevant if you try to consume the library right next to the it for a demo/test cause. |
@jvandemo No I didn't. Like @IsNull, I think |
Hi @n0daft.. Can you plz help me solve the issue?
|
@DashKalikalyan There can be multiple causes for this issue. In our case it were falsely linked export statements in the index (barrel) files. Unfortunately there were no compile time exceptions which could help. Does RecipeModule belong to another project/library or are you having the problem within the same project? In case of a library, check the |
ERROR in Error: Duplicated path in loadChildren detected: "./employer/employer.module#EmployerModule" is used in 2 loadChildren, but they point to different modules "(E:/Projects/angualr/recruithire/recruithire/src/app/pages/employer/employer.module.ts and "E:/Projects/angualr/recruithire/recruithire/src/app/client/employer/employer.module.ts"). Webpack cannot distinguish on context and would fail to load the proper Removing any one works fine but here I want to follow the same structure. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report
Versions.
Repro steps.
Replace code in
app.module.ts
with the following:The log given by the failure.
Note
It does not matter which module is used. It just fails at the first encountered module.ng build --prod
results in a bit more detailed error:Desired functionality.
The build should succeed. There shouldn't be any module annotations missing.
Mention any other details that might be useful.
We aren't sure if the error lies within our component libraries or within the using application. The libraries were all created with the angular2-library generator. The libraries can be found at:
It might be useful to check the compiled files of the libraries to make sure the files are in the expected format.
The following issues might be related, but no solution helped:
What we tried so far:
angular-cli
,typescript
"skipMetadataEmit": false
inangularCompilerOptions
of the tsconfig in the librariesThe text was updated successfully, but these errors were encountered: