nx
nx copied to clipboard
Nestjs serve crash after "File change detected. Restarting..."
Current Behavior
Serve command throw error Command failed: taskkill
Expected Behavior
Serve command should not throw error Command failed: taskkill
GitHub Repo
No response
Steps to Reproduce
- Init project with
npx create-nx-workspace@latest sample-nx
and select integrated nestjs app - Serve the nestjs app in development (Not error yet)
- Make the code in main.ts error
- correct it
- Boomπ₯Command failed: taskkill /pid
Nx Report
Node : 18.16.0
OS : win32 x64
npm : 9.5.1
Hasher : Native
nx (global) : 16.2.2
nx : 16.2.2
@nx/js : 16.2.2
@nx/jest : 16.2.2
@nx/linter : 16.2.2
@nx/workspace : 16.2.2
@nx/devkit : 16.2.2
@nx/eslint-plugin : 16.2.2
@nx/nest : 16.2.2
@nx/node : 16.2.2
@nrwl/tao : 16.2.2
@nx/webpack : 16.2.2
typescript : 5.0.4
Failure Logs
# nx run api:serve
> nx run api:serve:development
[Nest] 16848 - 05/25/2023, 2:19:18 PM LOG [NestFactory] Starting Nest application...
[Nest] 16848 - 05/25/2023, 2:19:18 PM LOG [InstanceLoader] AppModule dependencies initialized +7ms
[Nest] 16848 - 05/25/2023, 2:19:18 PM LOG [RoutesResolver] AppController {/api}: +13ms
[Nest] 16848 - 05/25/2023, 2:19:18 PM LOG [RouterExplorer] Mapped {/api, GET} route +1ms
[Nest] 16848 - 05/25/2023, 2:19:18 PM LOG [NestApplication] Nest application successfully started +1ms
[Nest] 16848 - 05/25/2023, 2:19:18 PM LOG π Application is running on: http://localhost:3000/api
> NX File change detected. Restarting...
> nx run api:build:development
chunk (runtime: main) main.js (main) 2.77 KiB [entry] [rendered]
ERROR in ./apps/api/src/app/app.controller.ts:11:28
TS2551: Property 'getDasta' does not exist on type 'AppService'. Did you mean 'getData'?
9 | @Get()
10 | getData() {
> 11 | return this.appService.getDasta();
| ^^^^^^^^
12 | }
13 | }
14 |
webpack compiled with 1 error (96bc2f0837570737)
> NX Running target build for project api failed
Failed tasks:
- api:build:development
Hint: run the command with --verbose for more details.
Build failed, waiting for changes to restart...
> NX File change detected. Restarting...
node:internal/errors:867
const err = new Error(message);
^
Error: Command failed: taskkill /pid 14736 /T /F
ERROR: The process "14736" not found.
at ChildProcess.exithandler (node:child_process:419:12)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
code: 128,
killed: false,
signal: null,
cmd: 'taskkill /pid 14736 /T /F'
}
Node.js v18.16.0
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> NX Running target serve for project api failed
Failed tasks:
- api:serve:development
Hint: run the command with --verbose for more details.
Operating System
- [ ] macOS
- [ ] Linux
- [x] Windows
- [ ] Other (Please specify)
Additional Information
No response
I can't reproduce this on macOS
, so it seems limited to a windows issue.
@Coly010 Yes, It's also working fine in my macOS
.
Got the same problem, as soon as it compile with errors. Have you fix this @thenglong ?
Nx Report
Node : 18.16.0
OS : win32 x64
npm : 9.6.7
Hasher : Native
nx : 16.3.0
@nx/js : 16.3.0
@nx/jest : 16.3.0
@nx/linter : 16.3.0
@nx/workspace : 16.3.0
@nx/angular : 16.3.0
@nx/cypress : 16.3.0
@nx/devkit : 16.3.0
@nx/eslint-plugin : 16.3.0
@nx/nest : 16.3.0
@nx/node : 16.3.0
@nrwl/tao : 16.3.0
@nx/webpack : 16.3.0
nx-cloud : 16.0.5
typescript : 5.0.4
Error message
node:internal/errors:867
const err = new Error(message);
^
Error: Command failed: taskkill /pid 5388 /T /F
ERROR: The process "5388" not found.
at ChildProcess.exithandler (node:child_process:419:12)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
code: 128,
killed: false,
signal: null,
cmd: 'taskkill /pid 5388 /T /F'
}
Node.js v18.16.0
@Leccho I ended up reverting and downgrading to v16.1.4.
I'm having a similar issue, it seems this appeared after I upgraded 16.3. I'll try to give more info later when I can.
I had a similar issue and downgrading fixed. Was on mac
Bad
β― nx report
> NX Report complete - copy this into the issue template
Node : 18.16.0
OS : darwin arm64
yarn : 1.22.18
Hasher : Native
nx : 16.2.2
@nx/js : 16.2.2
@nx/jest : 16.2.2
@nx/linter : 16.2.2
@nx/workspace : 16.2.2
@nx/devkit : 16.2.2
@nx/eslint-plugin : 16.2.2
@nx/nest : 16.2.2
@nx/node : 16.2.2
@nrwl/tao : 16.2.2
@nx/webpack : 16.2.2
typescript : 5.0.4
---------------------------------------
Community plugins:
@jscutlery/semver : 3.0.0
nest-commander-schematics : 3.0.0
> nx run ****:serve
> NX File change detected. Restarting...
> NX File change detected. Restarting...
Good
β― nx report
> NX Falling back to ts-node for local typescript execution. This may be a little slower.
- To fix this, ensure @swc-node/register and @swc/core have been installed
> NX Report complete - copy this into the issue template
Node : 18.16.0
OS : darwin arm64
yarn : 1.22.18
Hasher : Native
nx : 16.0.3
@nx/js : 16.0.3
@nx/jest : 16.0.3
@nx/linter : 16.0.3
@nx/workspace : 16.0.3
@nx/devkit : 16.0.3
@nx/eslint-plugin : 16.0.3
@nx/nest : 16.0.3
@nx/node : 16.0.3
@nrwl/tao : 16.0.3
@nx/webpack : 16.0.3
typescript : 4.9.5
---------------------------------------
Community plugins:
@jscutlery/semver : 2.30.1
nest-commander-schematics : 3.0.0
This issue is not windows specific - It's happening on mac and linux too. Tracking it here: https://github.com/nrwl/nx/issues/17070
Closing this in favor of #17070
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.