-
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
Angular MFE setup is broken after migration from 17 to 18 or 19 #26318
Comments
Hi @leosvelperez. Thanks a lot for so quick response. The changes you made fix the issue with broken run, but the issue with static server is our main problem. Even if we fix the devRemotes option issue, we need a way to opt out one static server for all remotes feature, or something that will allow us dynamically set remote definitions in manifest when running locally. |
Hi @VanTigranyan ! Indeed, dynamic federation has issues with the new approach which was introduced to save CPU and RAM resources on machines, particularly when there are a large number of remotes to be served. We are iterating on potential solutions and I hope to get a fix merged as soon as possible. I'm sorry for the inconvenience caused by this change and I do hope to resolve it as soon as I can. |
Awesome. Thank you very much. I am glad that it is on your radar. I should've reported this earlier, but I thought we could come up with a workaround. Unfortunately, no solution worked for us. So we'll eagerly wait for a solution from you. As I mentioned, even a simple opt-out would suffice, like disabling the single server with an option in project.json. Anyways, thanks again. |
Hi @VanTigranyan. An update from our side. We have decided on a fix for this and will look to implement it in the coming weeks. |
Hi @Coly010 Using your example repo, nx-ng-dyn-fed I also get an error with dynamic federation if I change the remote in your module-federation.manifest.json to one that is not inside that example project.
Downgrading to Nx 17.3.1 fixes the issue. Before I create a new issue, are you able to confirm it is related to this issue and that your example runs fine with the fix you have decided on above? |
@Coly010 Thank you very much. I'm looking forward to testing the fix out and upgrading our project |
@Coly010 What's the fix, if it's not a secret? 😄 |
@Coly010 any updates on this? We really are unable to upgrade, and it causes us a lot of trouble. I would appreciate any updates here. |
There's an open PR that should address this: #26782 |
…rver for static remotes (#26782) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> Remotes that are served for a host are usually served from a single file server running on a single port. We perform some mapping logic during the build of the host application to update the locations the remotes can be found at to point to the single file server. This works, but it's also wrong, as it breaks the flow that users expect. It also breaks dynamic remotes. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Continue to serve the remotes from a single file server, as this helps reduce the amount of resources used on developers machines. Use express to create proxy servers that will proxy requests from the original remote location to the single file server. This allows applications to continue to work without us having to interfere and map any remote locations. It also solves the issue with dynamic remotes. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #26318 (cherry picked from commit a549b9b)
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
We have a setup that uses NX for angular micro frontends. We utilize dynamic module federation for that. We have a shell app and several remote apps. Obviously, we have a manifest file that we use locally to run MFEs. In the manifest, we have the names of remote apps and the corresponding hosts and ports. A very standard setup that is suggested and even generated by NX. Ports in the manifest are different, of course, but after migration to the latest version, NX now runs just one static server for all remote apps. No problem, we can change all ports in manifest to point to the same host and port right? But what do we do when we want to run just one remote app via a dev server? Now I have to go and change the port in the manifest file for that remote app. I cannot commit this, as this is not what we expect from a dev server. So now, at least, the local setup for our MFEs is broken if we migrate to the latest version, and we are stuck on 17 because of this.
Here is the replication of the project after migration to 19th version. It doesn't even run.
Expected Behavior
We expect the old setup to still be supported, either by opting out of serving all remote apps by just one static server or with some other solution. The NX documentation and guides do not reflect the new logic of the local development setup, so we don't know what to do.
Here is the replication of our setup for NX 17, which works perfectly well. If we migrate it using NX to latest versions it breaks.
GitHub Repo
https://github.com/VanTigranyan/nx-mfe-repl-19
Steps to Reproduce
We can replicate this with 2 methods.
nx serve shell
Second method.
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
To summarize, we have two problems.
The text was updated successfully, but these errors were encountered: