-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Module Federation React + SSR Broken in 15.7.2 .Works on 15.4.4 (Cannot use 'import.meta' outside a module) #15125
Comments
Update after tonnes of trial and error, downgrading my entire workspace and all related nx dependencies from 15.7.2 to 15.4.4 "fixes" the issue for me (although it is more of a workaround than a fix!). Therefore, I believe there is a breaking bug in the latest NX |
Hello, we're experiencing the same problem. |
@triglian Were you able to get it working with 15.4.4? |
@stevebrowndotco no, the moment I introduce code as simple as a native |
For me this happens when using But i ended up moving away from the nx generated module federation completely. Currently module federation with SSR and react simply doesnt work on all versions of nx that I have tried. I can make some progress with 15.4.4 but it only supports one module (for SSR). The approach I am taking is to still generate my react apps with NX, but to implement the federated webpack plugins myself, which is quite straight forward and working fine. |
@stevebrowndotco good approach, I may have to do the same. |
@triglian you may check out my PoC here: https://github.com/stevebrowndotco/next-js-with-ssr-and-module-federation |
I'll take a look this week and provide fix. |
Sorry, this week I got bogged down by other things. I've started to investigate so will keep you updated on Monday (March 6th). |
…idest compatibility Fixes nrwl#15125
Fix is incoming. The workaround for now is to remove
|
…idest compatibility Fixes nrwl#15125
…idest compatibility Fixes nrwl#15125
…idest compatibility Fixes nrwl#15125
…idest compatibility Fixes nrwl#15125
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
Hello,
I am following the guide at https://nx.dev/recipes/module-federation/module-federation-with-ssr to the exact letter (at least I hope so!), I am doing this for React.
When I run
npx nx serve store
all of the remotes run fine, but the host app breaks because ofCannot use 'import.meta' outside a module
and never runs. If I remove the lazy load modules in app.tsx, the error goes awayExpected Behavior
When I run
npx nx serve store
I expect to see the store micro-frontend running. But it doesnt.GitHub Repo
https://github.com/stevebrowndotco/react-nx-module-federation-ssr
Steps to Reproduce
npx nx serve store
Nx Report
Failure Logs
It's worth noting that I get the following error appear in the terminal console:
Additional Information
Following the guide for a NON ssr project works perfectly for me, it's only when using SSR that I have issues.
The text was updated successfully, but these errors were encountered: