You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
Current behavior
When loading a lazy module, which imports SlugifyPipe directly. Then the app.module.ts imports a Shared Module with SlugifyPipe exported. It runs fine in the browser using ng serve, but when running ng build --prod it fails with the error:
ERROR in : Type SlugifyPipe in angular-pipes.d.ts is part of the declarations of 2 modules: SharedModule in shared.module.ts and NgStringPipesModule in angular-pipes.d.ts! Please consider moving SlugifyPipe in angular-pipes.d.ts to a higher module that imports SharedModule in shared.module.ts and NgStringPipesModule in angular-pipes.d.ts. You can also create a new NgModule that exports and includes SlugifyPipe in angular-pipes.d.ts then import that NgModule in SharedModule in shared.module.ts and NgStringPipesModule in angular-pipes.d.ts.
What is the motivation / use case for changing the behavior?
I believe it's a bug, Angular Universal static generation is stricter than normal runtime and it checks for duplicate imports
The text was updated successfully, but these errors were encountered:
Yeah it works fine in the browser, it's just when running a production static build with universal. I've noticed that it's stricter than the regular compiler. Sometimes throwing up other issues too.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current behavior
When loading a lazy module, which imports SlugifyPipe directly. Then the app.module.ts imports a Shared Module with SlugifyPipe exported. It runs fine in the browser using
ng serve
, but when runningng build --prod
it fails with the error:ERROR in : Type SlugifyPipe in angular-pipes.d.ts is part of the declarations of 2 modules: SharedModule in shared.module.ts and NgStringPipesModule in angular-pipes.d.ts! Please consider moving SlugifyPipe in angular-pipes.d.ts to a higher module that imports SharedModule in shared.module.ts and NgStringPipesModule in angular-pipes.d.ts. You can also create a new NgModule that exports and includes SlugifyPipe in angular-pipes.d.ts then import that NgModule in SharedModule in shared.module.ts and NgStringPipesModule in angular-pipes.d.ts.
Expected behavior
ng build --prod
to compileMinimal reproduction of the problem with instructions
Check out my example project for the source code i'm using:
https://github.com/kmturley/angular-google-sheets/blob/master/src/app/app.module.ts#L10
https://github.com/kmturley/angular-google-sheets/blob/master/src/app/shared/shared.module.ts
What is the motivation / use case for changing the behavior?
I believe it's a bug, Angular Universal static generation is stricter than normal runtime and it checks for duplicate imports
The text was updated successfully, but these errors were encountered: