-
Notifications
You must be signed in to change notification settings - Fork 327
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
Runtime APIs: MessageChannel #3273
Comments
Relabeling this as a feature request. The fact that we currently do not support |
First of all, thank you for a clear reproduction @phase! It helped me a lot understand what's going on. Secondly, I agree with @jasnell that supporting MessageChannel in workerd is indeed non-trivial because it doesn't fit the rest of the runtime well. Browsers and node can create new JS contexts at will via iframes or However, looking at this issue more deeply, i think the root cause of the failures in Astro and React is not that we don't support MessageChannel API, but rather that the bundlers somehow erroneously picks up I think we should get to the bottom of how these modules are resolved and resolve them correctly to address the Astro/React issue. |
After discussing a bit internally, I think we will likely implement |
My guess is that they use |
|
The workaround for when you need low latency tasks is to use MessageChannel API which is not throttled like this. |
Anyway, the point here is that due to some kind of build misconfiguration workerd is fed with js files intended specifically for browsers and not for servers which means that we might see additional issues due to this bundling issue and we should address that. I can have @dario-piotrowicz dig into this next week. |
The MessageChannel API is available on node but not CF Workers. This is causing an issue during the deployment of sites using React 19 + Astro + Workers, see facebook/react#31827 and withastro/astro#12824. The usage of this API may be a bug for this use case (meaning the solution there may be to stop using MessageChannel), but workerd may want to support it anyway.
I made a repository with steps to reproduce the crash mentioned in those issues here: https://github.com/phase/test-astro-react19-cf-workers
The text was updated successfully, but these errors were encountered: