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 running npx nx serve-ssr store, the server starts twice, causing conflicts and errors. This issue occurs because both server.ts and main.server.ts contain calls to the run() function, leading to the server being started twice.
Expected Behavior
The server should only start once when running npx nx serve-ssr store.
GitHub Repo
This issue was encountered while following the example from the NX documentation: Module Federation with SSR.
Steps to Reproduce
Run npx create-nx-workspace@latest myorg --preset=apps
nx add @nx/angular
npx nx g @nx/angular:host apps/store --ssr --remotes=product,checkout
E:\myorg>npx nx serve-ssr store
> nx run store:serve-ssr:development
****************************************************************************************
This is a simple server forusein testing or debugging Angular applications locally.
It hasn't been reviewed for security issues.DON'T USE IT FOR PRODUCTION!****************************************************************************************
- Generating browser application bundles (phase: setup)...
- Generating server application bundles (phase: setup)...
(node:12920) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
[ Module Federation Manifest Plugin ] Warn Manifest will use absolute path resolution via its host at runtime, reason: publicPath='auto'
✔ Browser application bundle generation complete.
✔ Browser application bundle generation complete.
- Copying assets...
✔ Copying assets complete.
- Generating index html...
✔ Server application bundle generation complete.
✔ Server application bundle generation complete.
✔ Index html generation complete.
Compiled successfully.
./node_modules/zone.js/fesm2015/zone-node.js:163
throw error;
^
Error: listen EADDRINUSE: address already in use :::7795
at Server.setupListenHandle [as _listen2] (node:net:1907:16)
at listenInCluster (node:net:1964:12)
at Server.listen (node:net:2066:7)
at Function.listen (E:\monorepo\myorg\dist\apps\store\server\255.js:8404:24)
at run (./apps/store/src/server.ts:57:10)
at Module.5965 (./apps/store/src/server.ts:69:3)
at module (./webpack/bootstrap:22:1)
at module (./webpack/runtime/readFile%20chunk%20loading:59:1)
at module (./webpack/runtime/readFile%20chunk%20loading:59:1)
at <anonymous> (./webpack/runtime/startup%20entrypoint:6:1)
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1943:8)
at invokeTask (./node_modules/zone.js/fesm2015/zone-node.js:402:33)
at runTask (./node_modules/zone.js/fesm2015/zone-node.js:159:47)
at invokeTask (./node_modules/zone.js/fesm2015/zone-node.js:483:34)
at apply (./node_modules/zone.js/fesm2015/zone-node.js:472:48)
at data.args.<computed> (./node_modules/zone.js/fesm2015/zone-node.js:950:25)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
code: 'EADDRINUSE',
errno: -4091,
syscall: 'listen',
address: '::',
port: 7795
}
Node.js v22.11.0
A server error has occurred.
node exited with 1 code.
** Angular Universal Live Development Server is listening on http://localhost:4200, open your browser on http://localhost:4200 **
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 running
npx nx serve-ssr store
, the server starts twice, causing conflicts and errors. This issue occurs because bothserver.ts
andmain.server.ts
contain calls to therun()
function, leading to the server being started twice.Expected Behavior
The server should only start once when running
npx nx serve-ssr store
.GitHub Repo
This issue was encountered while following the example from the NX documentation: Module Federation with SSR.
Steps to Reproduce
npx create-nx-workspace@latest myorg --preset=apps
npx nx serve-ssr store
.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: