node.jserror-handlingpromisebugsnag

Unhandled rejection event have conflict with bugsnag


I have some code with many unhandled rejections, and it is very hard to handle all of them. I want to handle them globally with 'unhandledrejection' event. But I have bugsnag in my project, and when some of the promise rejected, bugsnag catch them first and the app is killed after that. How can I avoid this?


Solution

  • I find a solution. It was because my bugsnag version was deprecated and it didn't support an unhandled rejection. I switch it to "@bugsnag/js": "^6.4.0", and all work very good!!!