Uncaught ReferenceError: MessageChannel is not defined
Updating different (unrelated) dependencies causes this. At least some seem to be related to React19 (which itself also causes this 🥲
I'm not sure it's directly CF related tho it only happens on
wrangler deploy
and only after building etc 🤔
Update: nodejs_compat
is already enabled in my wrangler.toml9 Replies
Hello! Same issue here
I am using pages and workers, I am getting this same issue
Are you using astro? or just apis?
An easy fix: just take your package.json to the previous configuration when it was working 🤣 And it really worked
but, do this at your own risk, because using unupdated packages is generally considered a security vulnerability
Anyways, I ain't from cloudflare, I am just someone like you getting errors and trying to fix them, lets wait for someone from cloudflare to reply
Yea this is working for me for now as well, it started to happen only with react 19, all other packages on latest, now it seems like as packages start to officially support react 19 they cause the same issue so now I have lots of outdated packages 🥲
Surprising that seemingly no one else seems to run into this so far 🤔
the code throwing error
GitHub
Bug: Uncaught ReferenceError: MessageChannel is not defined · Issue...
React version: 19.0.0 Steps To Reproduce Create an Astro & React project with server adapter for Cloudflare Try to deploy to Cloudflare Pages via wrangler deploy The current behavior Uncaught R...
nice, thank you for finding and reporting 🙏
Would love a solution to this!
It looks like someone else hit the unsupported
MessageChannel
API in Vercel's Edge Runtime https://github.com/vercel/next.js/issues/60337 but this is the only issue I can find & it was never resolved, so they might still not support it. Not sure if this is in the scope for workerd or if React should revert its usage.GitHub
Next.js 14.0.4 - Edge Runtime Warnings in scheduler Module · Issue ...
Link to the code that reproduces this issue https://github.com/Soheiljafarnejad/sabzlearn-front To Reproduce I am encountering warnings related to the use of Node.js APIs in the scheduler module wh...
@Mike Nomitch | Workers PM hi 👋 would opening an issue on workerd be appropriate for this?
@jado I think it is the React issue as MessageChannel is for the browsers only (or browser context).
mm i see