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

Using Webpack Compiler and watchAssets is true, nest start's process can't be stopped from entry file. #2303

Closed
2 of 4 tasks
tkow opened this issue Sep 24, 2023 · 1 comment

Comments

@tkow
Copy link
Contributor

tkow commented Sep 24, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

If we use nest webpack compiler and watchAssets flag is true, we can't exit a process created by nest start command because watchAssets listener is separated from bootstrap process. In the result, It's uncomfortable to use nest as command line tools using webpack, given if like nest-commander.

See: ( https://github.com/tkow/nest-watch-assets-demo/blob/master/src/main.ts )

Minimum reproduction code

https://github.com/tkow/nest-watch-assets-demo

Steps to reproduce

  1. pnpm i
  2. npx nest start -- hello
  3. The process isn't exited unless you send signal INT

Expected behavior

When process.exit() calls from somewhere of entry files the nest start process should stop.

Package version

10.0.1

NestJS version

10.0.1

Node.js version

18.15.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

I already suggest a way to fix this bug in the PR.
Also chokidar listener can't listen to complete all copied processes. So if watchAssets: false specified, I think its' better that nest's logic fallback to sync process and I did in it.

@tkow tkow changed the title Using Webpack Compiler and watchAssets is true, nest start's process can't be stopped from entry fie. Using Webpack Compiler and watchAssets is true, nest start's process can't be stopped from entry file. Oct 5, 2023
@kamilmysliwiec
Copy link
Member

Let's track this here #2293

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

2 participants