Skip to content
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

@nx/angular - Error serving multiple remotes at the same time #28479

Open
1 of 4 tasks
imuricy opened this issue Oct 17, 2024 · 0 comments
Open
1 of 4 tasks

@nx/angular - Error serving multiple remotes at the same time #28479

imuricy opened this issue Oct 17, 2024 · 0 comments

Comments

@imuricy
Copy link

imuricy commented Oct 17, 2024

Current Behavior

When trying to serve shell application with more than 1 remotes at the same time, only 1 remote will work.
There is an issue serving remoteEntry.mjs file on one of the remotes

Expected Behavior

Both remotes should work, serving remoteEntry.mjs to inject routes for module federation.

GitHub Repo

No response

Steps to Reproduce

  1. npx create-nx-workspace@latest nx-test --preset=angular-monorepo
  2. nx g @nx/angular:host apps/home --prefix=nx-test --dynamic
  3. nx g @nx/angular:remote apps/mf1 --prefix=nx-test --host=home
  4. nx g @nx/angular:remote apps/mf2 --prefix=nx-test --host=home

ng serve home --devRemotes=mf1,mf2 or ng serve home --devRemotes="mf1,mf2"

Navigate between routes, only one MicroFront will work, the other ones fails to download remoteEntry.mjs

Nx Report

NX Report complete - copy this into the issue template

Node : 20.17.0
OS : linux-x64
Native Target : x86_64-linux
npm : 10.8.3

nx (global) : 19.8.0
nx : 20.0.1
@nx/js : 20.0.1
@nx/jest : 20.0.1
@nx/eslint : 20.0.1
@nx/workspace : 20.0.1
@nx/angular : 20.0.1
@nx/devkit : 20.0.1
@nx/eslint-plugin : 20.0.1
@nx/web : 20.0.1
@nx/webpack : 20.0.1
typescript : 5.5.4

Failure Logs

http://localhost:4201/remoteEntry.mjs

HTTP/1.1 404 Not Found
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'none'
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8
Content-Length: 154
Date: Thu, 17 Oct 2024 02:56:31 GMT
Connection: keep-alive
Keep-Alive: timeout=5

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Starting one remote at a time, works fine.
The remotes served as static have the route to the remoteEntry.mjs file served.

The other contents of the remote app works just fine, app is rendered as expected when accessing via remote port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant