-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Nx + Module federation + Angular gives error NG0912 when using ng-zorro-antd #26878
Comments
This usually happens when there are two components registered to the single Angular instance in the browser from different places. In other words, if those components come from The library in this case would likely be better to be shared. It should be done automatically, unless you have specifically chosen to opt out of sharing that package. If you haven't opted out, I will need a reproduction repo to investigate further. |
I will try to do this (repo) in nearest weekends |
similar issue,NzIconService is exported from the tripartite component library |
@Coly010 I create test repository (see main comment). How reproduce: All information in English. Then go to remote application and you will see: A like image, but import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
import { appRoutes } from './app.routes';
import { en_US, provideNzI18n } from 'ng-zorro-antd/i18n';
import en from '@angular/common/locales/en';
import { registerLocaleData } from '@angular/common';
registerLocaleData(en);
export const appConfig: ApplicationConfig = {
providers: [
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(appRoutes),
provideNzI18n(en_US),
],
}; In |
+1 |
I know the problem, finding a solution may be a bit tricker. It's related to the package structure from |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Switching between different pages is given us the following warnings:
NG0912: Component ID generation collision detected. Components 'NzSelectClearComponent' and 'NzSelectClearComponent' with selector 'nz-select-clear' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID. Find more at https://angular.dev/errors/NG0912
NG0912: Component ID generation collision detected. Components 'NzTextCopyComponent' and 'NzTextCopyComponent' with selector 'nz-text-copy' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID. Find more at https://angular.dev/errors/NG0912
Expected Behavior
No warning (for us this warning cause errors in production)
GitHub Repo
nx-mfe-ng-zorro
Steps to Reproduce
ng-zorro-antd
:18.0.1
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
This issue is reproduced when upgrading Angular and
ng-zorro-antd
to version 17 and more. In version 16 this problem not reproducedThe text was updated successfully, but these errors were encountered: