You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a fresh module-federated react app, the serve-static command fails for remote applications with a port issue. This in turn means the e2e command fails.
[WebServer] node:internal/validators:424
[WebServer] throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);
[WebServer] ^
[WebServer] RangeError: Port should be >= 0 and < 65536. Received type number (-Infinity).
[WebServer] at validatePort (node:internal/validators:424:11)
[WebServer] at lookupAndConnect (node:net:1289:5)
[WebServer] at Socket.connect (node:net:1246:5)
[WebServer] at checkPort (/Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/web/src/utils/wait-for-port-open.js:40:20)
[WebServer] at /Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/web/src/utils/wait-for-port-open.js:42:9
[WebServer] at new Promise (<anonymous>)
[WebServer] at waitForPortOpen (/Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/web/src/utils/wait-for-port-open.js:9:12)
[WebServer] at /Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/rspack/src/executors/module-federation-static-server/module-federation-static-server.impl.js:214:101
[WebServer] at Array.map (<anonymous>)
[WebServer] at /Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/rspack/src/executors/module-federation-static-server/module-federation-static-server.impl.js:214:46 {
[WebServer] code: 'ERR_SOCKET_BAD_PORT'
[WebServer] }
[WebServer] Node.js v20.10.0
Error: Process from config.webServer was not able to start. Exit code: 1
Expected Behavior
The serve-static command should build and serve the app locally so that the e2e step can test against it.
> nx run shop:serve-static:production
NX Starting module federation dev-server for shop with 0 remotes
NX Built host
NX Starting static remotes proxies...
NX Static remotes proxies started successfully
NX Starting static host proxy...
NX Static host proxy started successfully
node:internal/validators:424
throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);
^
RangeError: Port should be >= 0 and < 65536. Received type number (-Infinity).
at validatePort (node:internal/validators:424:11)
at lookupAndConnect (node:net:1289:5)
at Socket.connect (node:net:1246:5)
at checkPort (/Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/web/src/utils/wait-for-port-open.js:40:20)
at /Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/web/src/utils/wait-for-port-open.js:42:9
at new Promise (<anonymous>)
at waitForPortOpen (/Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/web/src/utils/wait-for-port-open.js:9:12)
at /Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/rspack/src/executors/module-federation-static-server/module-federation-static-server.impl.js:214:101
at Array.map (<anonymous>)
at /Users/ozealley/projects/nx-module-federation-issues/node_modules/@nx/rspack/src/executors/module-federation-static-server/module-federation-static-server.impl.js:214:46 {
code: 'ERR_SOCKET_BAD_PORT'
}
Node.js v20.10.0
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
When creating a fresh module-federated react app, the
serve-static
command fails for remote applications with a port issue. This in turn means the e2e command fails.Expected Behavior
The
serve-static
command should build and serve the app locally so that the e2e step can test against it.GitHub Repo
https://github.com/oscar8880/nx-module-federation-issues/tree/e2e-issue
Steps to Reproduce
e2e-issue
npm install
nx e2e shop-e2e
ornx serve-static shop
To create the example I followed the docs here https://nx.dev/concepts/module-federation/faster-builds-with-module-federation. I'm using nx
20.4.6
, nodev20.10.0
, npm10.2.3
.npx create-nx-workspace nx-module-federation-issues --preset=apps
nx add @nx/react
nx g @nx/react:host apps/host --remotes=shop
nx e2e shop-e2e
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: