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

fix(node): fire 'unhandledrejection' event when using node: or npm: imports #19235

Conversation

bartlomieju
Copy link
Member

This commit fixes emitting "unhandledrejection" event when there are
"node:" or "npm:" imports.

Before this commit the Node "unhandledRejection" event was emitted
using a regular listener for Web "unhandledrejection" event. This listener
was installed before any user listener had a chance to be installed which
effectively prevent emitting "unhandledrejection" events to user code.

Closes #16928

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bartlomieju bartlomieju merged commit 0bb5bbc into denoland:main May 24, 2023
@bartlomieju bartlomieju deleted the handle_unhandled_rejection_in_node_compat branch May 24, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unhandledrejection is not working for anonymous async function promises. Some code works in nodejs
2 participants