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

Add unhandledrejection & rejectionhandled event support #108

Closed
Kikobeats opened this issue Dec 3, 2021 · 4 comments
Closed

Add unhandledrejection & rejectionhandled event support #108

Kikobeats opened this issue Dec 3, 2021 · 4 comments
Labels
fixed-in-next Fixed in next release new api Unsupported new Workers runtime API

Comments

@Kikobeats
Copy link
Contributor

Hello,

According to CF Workers release, the environment supports unhandledrejection and rejectionhandled events.

I double-check at miniflare code and looks like these events are not supported yet.

Do you think could be easy to add them?

source code related:

this.addEventListener = this.addEventListener.bind(this);

@mrbbot
Copy link
Contributor

mrbbot commented Dec 3, 2021

Hey! 👋 The Miniflare 2 pre-release (miniflare@next) includes support for these events.

I understand from #103 (comment) that you're currently using CommonJS imports though. What's your use case, and is there a reason you can't use dynamic await import("miniflare")?

@mrbbot mrbbot closed this as completed Dec 3, 2021
@mrbbot mrbbot added fixed-in-next Fixed in next release new api Unsupported new Workers runtime API labels Dec 3, 2021
@Kikobeats
Copy link
Contributor Author

ops sorry, every time I use GitHub to search it doesn't take a look inside branches 😭

I can't use dynamic import because jest has some problem with that and looks like it's actually a v8 thing
nodejs/node#35889

I'm using miniflare to emulate the runtime before ship code to production, and since the issue with jest (and is not possible to move jest out of the project) I'm still stuck at miniflare v1

@mrbbot
Copy link
Contributor

mrbbot commented Dec 3, 2021

Have you tried out Jest's experimental ES modules support? https://jestjs.io/docs/ecmascript-modules

@Kikobeats
Copy link
Contributor Author

unfortunately is hard than that; the project is usingts-jest and is failing using the esm configuration support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-next Fixed in next release new api Unsupported new Workers runtime API
Projects
None yet
Development

No branches or pull requests

2 participants