-
Notifications
You must be signed in to change notification settings - Fork 41
Fix node timers #619
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 timers #619
Conversation
🦋 Changeset detectedLatest commit: 6b466c9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Thanks for the fix @conico974 FYI this was discussed internally and we decided that mixing APIs would not be a problem (documented here). I'll raise the issue again internally. One possible fix would be to update unenv (with the caveat that external modules would not be polyfilled). For now I'm +1 for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Added a link to workerd code
Co-authored-by: Victor Berchet <victor@suumit.com>
It is expected that the global timers (i.e.
setInterval
,setTimeout
) in Node returns aNodejs.Timeout
instead of a number. On cloudflare workers they return a number.This can cause some unexpected crash like in #587, where sentry tries to call
unref()
on the created interval.This PR fix #587
The only downsides to doing that is that in the middleware we'll have access to the Node version as well, but i don't think this is too big of an issue