"@nrwl/workspace": "^8.8.0"all specified projects get served, when running nx run-many --target=serve --projects=<more than 3 projects> --parallel
only the first 3 projects get served
console outputs:
nx run-many --target=serve --projects=one,two,three,four --parallel
NX Running target serve for projects:
- one
- two
- three
- four
[email protected] nx <path-to-project>\nx-min
nx "run" "two:serve"
[email protected] nx <path-to-project>\nx-min
nx "run" "three:serve"
[email protected] nx <path-to-project>\nx-min
nx "run" "one:serve"
Please provide detailed steps for reproducing the issue.
npx create-nx-workspace@latest nx-mincd nx-minnx g @nrwl/nest:application onenx g @nrwl/nest:application twonx g @nrwl/nest:application threenx g @nrwl/nest:application fournx run-many --target=serve --projects=one,two,three,four --parallelPlease provide any relevant information about your setup:
nx report : @nrwl/angular : Not Found
@nrwl/cli : 8.8.0
@nrwl/cypress : Not Found
@nrwl/eslint-plugin-nx : 8.8.0
@nrwl/express : Not Found
@nrwl/jest : 8.8.0
@nrwl/linter : 8.8.0
@nrwl/nest : 8.8.0
@nrwl/next : Not Found
@nrwl/node : 8.8.0
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 8.8.0
@nrwl/web : Not Found
@nrwl/workspace : 8.8.0
typescript : 3.5.3
You should be able to work around this by setting the --maxParallel flag to a high number, for example:
nx run-many --target=serve --projects=one,two,three,four --parallel --maxParallel=100
The default value for --maxParallel is three, meaning that it runs tasks in batches of three by default. Since the "serve" target never exits, the run-many command never made it to the second batch of tasks.
To avoid further confusion about this situation, there could be a warning logged when the "serve" target is used with the run-many command.
This is actually a use-case for run-many we didn't consider :) @AdamVig a warning is a good idea, probably not something we are going to do right now, but we would likely accept a PR for it
@AdamVig thanks for the tip
my use-case is running multiple nest services. And I didn`t like the method I used before (here) and when i saw the addition of run-many I had to try it
I'm using nx in a kind of microfront ends and I also want to run several at the same time on the same port, but with different paths ... how would it be possible to do that? do these solutions work or should i go for the idea of a proxy?
Most helpful comment
You should be able to work around this by setting the
--maxParallelflag to a high number, for example:The default value for
--maxParallelis three, meaning that it runs tasks in batches of three by default. Since the "serve" target never exits, therun-manycommand never made it to the second batch of tasks.To avoid further confusion about this situation, there could be a warning logged when the "serve" target is used with the
run-manycommand.