We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using the default HMR example EADDRINUSE errors can occur, likely because close() is not awaited.
EADDRINUSE
close()
Maybe the example should look something like this instead:
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; async function bootstrap() { if (module.hot?.data?.closePromise) { await module.hot.data.closePromise; module.hot.data.closePromise = null; } const app = await NestFactory.create(AppModule, { forceCloseConnections: !!module.hot, }); if (module.hot) { module.hot.accept(); module.hot.dispose((data) => data.closePromise = app.close()); } await app.listen(3000); } bootstrap();
https://docs.nestjs.com/recipes/hot-reload
The text was updated successfully, but these errors were encountered:
would you like to open a PR at https://github.com/nestjs/docs.nestjs.com
Sorry, something went wrong.
Thanks for the pointer. I'll do so once I'm reasonably sure that this fixed the sporadic EADDRINUSE I've been getting.
No branches or pull requests
Is there an existing issue for this?
Current behavior
When using the default HMR example
EADDRINUSE
errors can occur, likely becauseclose()
is not awaited.Maybe the example should look something like this instead:
Minimum reproduction code
https://docs.nestjs.com/recipes/hot-reload
In which operating systems have you tested?
The text was updated successfully, but these errors were encountered: