-
Notifications
You must be signed in to change notification settings - Fork 259
Description
With what library do you have an issue?
module-federation
Reproduction of the bug/regression with instructions
Steps to reproduce:
npx create-nx-workspace // use angular templatenpx nx g @nx/angular:application apps/testnpm install --save-dev @angular-architects/module-federationnpx nx g @angular-architects/module-federation:init --type hostnpx nx serve test --configuration productionWhen running application i get errors like:
Details
In dev build everything works fine.
I got also another errors, but meaning same - some imported modules property/function was undefined.
How to fix?
I fixed this by removing commonChunk: false option from project.json
I'm not sure if this is correct way as module-federation:init generator explicitly sets commonChunk: false.
According to angular docs: https://angular.dev/tools/cli/build-system-migration commonChunk should be removed, as this was a performance optimization which is no longer needed.
However this seems like it applies to esbuild related builders, not the webpack ones.
Also - creating application which does not use module-federation and setting there "commonChunk: false" makes angular app still working, so the issue is related not to angular itself, but module-federation package.
Expected behavior
I expect module-federation to properly work in angular 21 webpack based builds
Versions of Native/Module Federation, Angular, Node, Browser, and operating system
Module Federation: 20.0.0
Angular: 21.1.1
Nx: 22.5.1
Other information
No response
I would be willing to submit a PR to fix this issue
- Yes
- No