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 🤔

Total Upload: 20484.96 KiB / gzip: 3636.26 KiB

✘ [ERROR] A request to the Cloudflare API (/accounts/ddddc353374f7ec886d7d7d97e239a71/workers/scripts/rakkas-cf-origin/versions) failed.

  Uncaught ReferenceError: MessageChannel is not defined
    at null.<anonymous>
  (file://[..]/node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/cjs/react-dom-server.browser.production.js:126:15)
  in
  ../../node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/cjs/react-dom-server.browser.production.js
    at null.<anonymous> (entry-cf.js:32:50) in __require2
    at null.<anonymous>
  (file://[..]/node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/server.browser.js:6:7)
  in ../../node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/server.browser.js
    at null.<anonymous> (entry-cf.js:32:50) in __require2
    at null.<anonymous>
  (file://[..]/dist/edge/hattip.js:12:62)
  in dist/edge/hattip.js
    at null.<anonymous> (entry-cf.js:29:59) in __init
    at null.<anonymous>
  (file://[..]/dist/edge/entry-cf.js:2:1)
   [code: 10021]


Update: nodejs_compat is already enabled in my wrangler.toml
Was this page helpful?