nx
nx copied to clipboard
Broken recipe Module Federation with SSR for Angular
Current Behavior
I just follow all steps in: https://nx.dev/recipes/module-federation/module-federation-with-ssr and when I run npx nx serve-ssr store --devRemotes=checkout it throws error:
Error: Shared module is not available for eager consumption: 4112
4112 = @angular/platform-server
It is required as eager module because it is imported in main.server.ts for bootstrap of ngExpressEngine
Expected Behavior
It should start the server without any errors.
GitHub Repo
No response
Steps to Reproduce
- Follow steps in https://nx.dev/recipes/module-federation/module-federation-with-ssr
- Get error on last step
Nx Report
Node : 20.2.0
OS : win32 x64
npm : 9.6.6
Hasher : Native
nx (global) : 16.2.2
nx : 16.2.2
@nx/js : 16.2.2
@nx/jest : 16.2.2
@nx/linter : 16.2.2
@nx/workspace : 16.2.2
@nx/angular : 16.2.2
@nx/cypress : 16.2.2
@nx/devkit : 16.2.2
@nx/eslint-plugin : 16.2.2
@nrwl/tao : 16.2.2
@nx/web : 16.2.2
@nx/webpack : 16.2.2
nx-cloud : 16.0.5
typescript : 5.0.4
---------------------------------------
Community plugins:
@nguniversal/builders : 16.0.2
@nguniversal/express-engine : 16.0.2
Failure Logs
No response
Operating System
- [ ] macOS
- [ ] Linux
- [X] Windows
- [ ] Other (Please specify)
Additional Information
No response
Hi @LadaBr, We also had this issue #15562 . The only workaround we could have was to run it inside a docker container. You might also have the option to mark certain modules as 'eager' in federation configs; However, this is somewhat cumbersome as you need to do this manually for each problematic dependency. Hope it helps.
Any update on this? I am still facing this problem?
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏
Issue still persist
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.