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 run-many --target=serve --all not serve all projects in windows os. #30299

Open
1 of 4 tasks
KamakshiReddyADL opened this issue Mar 7, 2025 · 0 comments
Open
1 of 4 tasks

Comments

@KamakshiReddyADL
Copy link

Current Behavior

Hi Team,

i followed below steps to create react project using nx and i added 3 projects names as app(port 4200), my-second-app(port 4201), my-third-app(port 4203).

npx create-nx-workspace@latest sample
nx generate @nrwl/react:application app --style=css --routing --no-interactive

nx generate @nx/react:application my-second-app --style=css --routing --no-interactive

nx g @nx/react:application my-third-app --directory apps/my-third-app

and i added custom script in package.json like
"scripts": {
"serve:all": "nx run-many --target=serve --all",
"build:all": "nx run-many --target=build --all"
}
and after running below the command only my-second-app and my-third-app only ruiing
npm run build:all && npm run serve:all

[webpack-dev-server] Loopback: http://localhost:4201/
[webpack-dev-server] Content not from webpack is served from 'C:\Practice\sample\apps\my-second-app\public' directory
[webpack-dev-server] Loopback: http://localhost:4202/
[webpack-dev-server] Content not from webpack is served from 'C:\Practice\sample\apps\my-third-app\public' directory

please help on this and find below logs for reference.

$ npm run build:all && npm run serve:all

@sample/[email protected] build:all
nx run-many --target=build --all

√ nx run my-second-app:build [local cache]
√ nx run my-third-app:build [local cache]
√ nx run app:build [local cache]

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

NX Successfully ran target build for 3 projects (485ms)

Nx read the output from the cache instead of running the command for 3 out of 3 tasks.

@sample/[email protected] serve:all
nx run-many --target=serve --all

NX Running target serve for 3 projects:

  • my-second-app
  • my-third-app
  • app

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

nx run my-second-app:serve

nx run my-third-app:serve

nx run app:serve

[webpack-dev-server] Project is running at:
[webpack-dev-server] Loopback: http://localhost:4201/
[webpack-dev-server] Content not from webpack is served from 'C:\Practice\sample\apps\my-second-app\public' directory
[webpack-dev-server] Loopback: http://localhost:4202/
[webpack-dev-server] Content not from webpack is served from 'C:\Practice\sample\apps\my-third-app\public' directory

Entrypoint main [big] 1.64 MiB (2.21 MiB) = runtime.js 47.1 KiB vendor.js 1.54 MiB main.js 60.3 KiB 3 auxiliary assets
Entrypoint styles 234 KiB (385 KiB) = runtime.js 47.1 KiB styles.css 119 bytes styles.js 186 KiB 3 auxiliary assets
chunk (runtime: runtime) main.js (main) 56.6 KiB [initial] [rendered]
chunk (runtime: runtime) runtime.js (runtime) 31.7 KiB [entry] [rendered]
chunk (runtime: runtime) styles.css, styles.js (styles) 180 KiB (javascript) 80 bytes (css/mini-extract) [initial] [rendered]
chunk (runtime: runtime) vendor.js (vendor) (id hint: vendor) 1.51 MiB [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
webpack compiled successfully (5a10f72a7184f5b0)
Type-checking in progress...
Entrypoint main [big] 1.64 MiB (2.21 MiB) = runtime.js 47.1 KiB vendor.js 1.54 MiB main.js 60.3 KiB 3 auxiliary assets
Entrypoint styles 234 KiB (385 KiB) = runtime.js 47.1 KiB styles.css 119 bytes styles.js 186 KiB 3 auxiliary assets
chunk (runtime: runtime) main.js (main) 56.6 KiB [initial] [rendered]
chunk (runtime: runtime) runtime.js (runtime) 31.7 KiB [entry] [rendered]
chunk (runtime: runtime) styles.css, styles.js (styles) 180 KiB (javascript) 80 bytes (css/mini-extract) [initial] [rendered]
chunk (runtime: runtime) vendor.js (vendor) (id hint: vendor) 1.51 MiB [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
webpack compiled successfully (ab0a1d4cfdbb00f5)
Type-checking in progress...
No errors found.
No errors found.

Expected Behavior

should run all projects

GitHub Repo

No response

Steps to Reproduce

  1. follow below steps and run project
    npx create-nx-workspace@latest sample
    nx generate @nrwl/react:application app --style=css --routing --no-interactive

nx generate @nx/react:application my-second-app --style=css --routing --no-interactive

nx g @nx/react:application my-third-app --directory apps/my-third-app

Nx Report

$ nx report

 NX   Report complete - copy this into the issue template

Node   : 20.11.1
OS     : win32-x64
npm    : 10.2.4

nx (global)        : 20.4.6
nx                 : 18.0.7
@nx/js             : 18.0.7
@nx/jest           : 18.0.7
@nx/linter         : 18.0.7
@nx/eslint         : 18.0.7
@nx/workspace      : 18.0.7
@nx/cypress        : 18.0.7
@nx/devkit         : 18.0.7
@nx/eslint-plugin  : 18.0.7
@nx/react          : 18.0.7
@nrwl/tao          : 18.0.7
@nx/web            : 18.0.7
@nx/webpack        : 18.0.7
typescript         : 5.3.3

Failure Logs

Package Manager Version

10.2.4

Operating System

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

Additional Information

No response

@KamakshiReddyADL KamakshiReddyADL changed the title nx run-many --target=build --all not serve all projects in windows os nx run-many --target=serve --all not serve all projects in windows os. Mar 7, 2025
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