-
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
Module federation dev server static remote copy logic is incorrect. #21392
Comments
Hi @statop ! Can you provide an example even just as a comment here of when this occurs and why this is a bug? We only need to move projects into a common location when there is more than 1 static remote. To allow a single When Production builds will still use the correct location defined in |
The code here That is not always the case. |
In other words, if the output path for my project, which is named foo-bar, is dist/foo/bar, then the server will serve up the foo directory and try to load resources from a non-existant foo-bar directory |
This should be solved by this line, no? nx/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts Line 76 in 81be1e5
I know now how to test this at least |
in the case of more than one static remote, yes. The problem is when there is only one static remote. |
@Coly010 there is still a problem when the output directory does not contain the whole project name |
@statop I cannot reproduce that behaviour on the latest version of Nx. If you can provide a reproduction repo, I'll happily reopen this and take a look. |
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
If I only have 1 static remote, the federation dev server serves a different directory structure than if I had more than one.
Expected Behavior
If I only have 1 static remote, the federation dev server serves a the same directory structure than if I had more than one.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
pnpm 8.14.3
Operating System
Additional Information
The problematic code is here - https://github.com/nrwl/nx/blob/master/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts#L58
It assumes that all projects output to a folder with the project name. Many projects use a path that matches the path to the project sources.
The text was updated successfully, but these errors were encountered: