nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.47k stars 280 forks source link

unhandled-rejection with domain module (Node15+) #4330

Closed ZaxYonatan closed 3 months ago

ZaxYonatan commented 8 months ago

Details

Hi 👋 We have a node service that uses the domain module We're working on upgrading from version 14 to version 18, and we've noticed that unhandled-rejections is strict since node15. We tried to use the --unhandled-rejections=warn but it doesn't seem to work with domain (Note that our service runs User Code and we don't have control on their code that doesn't handle rejections)

we wanted to ask:

  1. Is there a way to handle unhandled-rejections in Node18 while still using the deprecated domain module?
  2. Is there a way to "mark" unhandled-rejections is such a way that it would be possible to ignore them in the "uncaught-exception"?
  3. what are the alternatives to replace domain module?

Node.js version

Node15 +

Example code

No response

Operating system

linux

Scope

runtime

Module and version

domain module

RedYetiDev commented 3 months ago

Hi! You can handle deprecations via the CLI, as documented in https://nodejs.org/api/deprecations.html.