Package*.json entry in angular.json assets causes node serve infinite loop
See original GitHub issueCurrent Behavior
After upgrading from NX 10.0.13 to 10.1.0 When serving my Nest app in development mode it successfully compiles then starts compiling in an infinite loop. The serving an Angular is working correctly, this is specific to a node Nest app.
Note that it works if I revert the @nrwl/node
dependency from 10.1.0 to 10.0.13 but leave all other nrwl dependencies alone, so it’s a regression specifically with @nrwl/node 10.1.0.
Expected Behavior
nx serve should only recompile when file in project changes and shouldn’t infinite loop.
Steps to Reproduce
I was not able to reproduce on a newly created NX Nest app but I did go through all the changes in @nrwl/node 10.1.0 and didn’t see anything that stood out to me https://github.com/nrwl/nx/commits/master/packages/node
Failure Logs
There is no failures, just infinite loop, do you have any recommendations on how to log the issue?
Environment
Working:
nx : Not Found
@nrwl/angular : 10.1.0
@nrwl/cli : 10.1.0
@nrwl/cypress : 10.1.0
@nrwl/eslint-plugin-nx : 10.1.0
@nrwl/express : 10.1.0
@nrwl/jest : 10.1.0
@nrwl/linter : 10.1.0
@nrwl/nest : 10.1.0
@nrwl/next : Not Found
@nrwl/node : 10.0.13
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 10.0.13
@nrwl/web : Not Found
@nrwl/workspace : 10.1.0
typescript : 3.9.7
Not Working:
nx : Not Found
@nrwl/angular : 10.1.0
@nrwl/cli : 10.1.0
@nrwl/cypress : 10.1.0
@nrwl/eslint-plugin-nx : 10.1.0
@nrwl/express : 10.1.0
@nrwl/jest : 10.1.0
@nrwl/linter : 10.1.0
@nrwl/nest : 10.1.0
@nrwl/next : Not Found
@nrwl/node : 10.1.0
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 10.0.13
@nrwl/web : Not Found
@nrwl/workspace : 10.1.0
typescript : 3.9.7
Thank you for the help!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Found the problem in our project’s case. We had the following in the workspace.json
build
config for the app:Removing the
package*.json
stopped the infinite restart loop. I think the reason it was in there is because a developer had wanted package.json and package-lock.json in the app’s dist folder so they could runnpm install
directly from the dist.So, I spoke too soon - we also need the package files to build a docker image down the line. That’s what I get for taking summer vacation and forgetting all the things 😄
Anyway, removing the
*
glob and explicitly listing both files also fixed the restart loop on my end. Hopefully it’ll work for you too @arjunyel: