-
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
Federated modules don't work going from nx 17 to nx 18 #21632
Comments
I couldn't reproduce it on the Additionally, you could take a look at the shell's Sorry if I teach you how to suck eggs here, but trying to be helpful 😄 @edit |
@ptakpatryk Thanks very much for your response here this is helpful, I will try nx reset as well and see if that fixes it, if not I will attempt to replicate and strip down the project as an example. The remotes thing you mentioned here is interesting too. In nx 17 I didn't have to specify these remotes in a development configuration in the webpack config on localhost. Of course for production and stuff I have to refer to where the federated module is hosted, but using the module-federation.config.js was sufficient previously: module.exports = { In nx 17 what would happen is it seemed like nx would look at all my of my remote app project.json |
@ptakpatryk It looks like now I must specify --devRemotes when starting shell. Previously it seemed like NX would automatically determine which --devRemotes to use |
Even after specifying |
Hi @Aubrey-Russell, @isunilmekala, Could you please create a repo with this issue reproduced? You could also try running it on your end, who knows - it might be specific to the Windows platform. If that's the case I will try my luck on debugging it on my Windows machine. |
Can this be related to this issue? #20974 We cannot update to Nx 17.3+ since now we are forced to have all static remoted starting up on the same port. But that doesn't work as they use different ports in devRemote mode. Is there a solution to this? or we will not be able to update top any newer Nx? |
The original issue reported in this thread should have been addressed by #21709, which was released in Nx 18.0.4. There was an issue with the remapping done to the remote URL when the project had a single remote (when serving static remotes).
You need to specify which remotes you want to serve in development mode. Those specified with the
That's a different issue, and you can continue the conversation over that thread. @Aubrey-Russell could you please try again with the latest version and see if the issue is solved for you? |
@leosvelperez thanks for your message, I will try the latest version today and see if that works |
@leosvelperez Weirdly enough it completely fails to launch now. Running with verbose doesn't give me any more information \node_modules.pnpm@nx+react@18.0.4_@swc-node+register@1.8.0_@swc+core@1.4.1_@types[email protected][email protected][email protected]\node_modules@nx\react\src\executors\module-federation-dev-server\module-federation-dev-server.impl.js:111 Error: Remote failed to start. See above for errors. Node.js v21.1.0 Report Node : 21.1.0 nx : 18.0.4 |
Ill see if I can create a separate repo that replicates this issue that I can share |
if I specify devRemotes on 18.0.4 then there's no error or problem. To clarify--I don't want to start the federated modules in development mode, but this enables nx to detect and point to the federated modules without error |
That's definitely not expected. Something else might be going on. Please provide a reproduction so we can troubleshoot it. |
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. |
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. |
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
Upgrading to NX 18 from 17 breaks all federated module stuff
Expected Behavior
Remote federated modules should work as expected when migrating from nx 17 to nx 18
GitHub Repo
No response
Steps to Reproduce
Instead of the shell, running on localhost:4200, referencing federated module remote entry on, say, localhost:9007 like on nx 17 as is configured in remote app project.json, now bizarrely its looking on localhost:4201/remoteEntry.js
NX never launches anything on localhost:4201; there's nothing there and I never configured it to run anything on localhost:4201 so it makes sense why remote entry cannot be found
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: