Failed to analyze auth.js: Uncaught ReferenceError: MessageChannel is not defined
Error message: Error fetching POST 400 Bad Request: InvalidModules: Hit an error while pushing:
Loading the pushed modules encountered the following
error:
Failed to analyze auth.js: Uncaught ReferenceError: MessageChannel is not defined
attached the auth.ts code.
5 Replies
That's an issue with Resend, workarounds here until it's fixed upstream: https://discord.com/channels/1019350475847499849/1328374779635302510/1357014788839833753
We’ve already tried that workaround, but we're still encountering the same error.
We also added the following to our convex.json, but it didn’t resolve the issue:
{
"node": {
"externalPackages": ["ai", "react-dom", "resend", "*"]
}
}
You have to import the polyfill, pasting it at the top won't work. The imports will still run before that code executes.
Put it in a polyfills.ts file or something and import that file before all the others.
I’ve created a separate polyfills.ts file and imported it at the top level of auth.ts, but we’re still encountering the same error.
That’s pretty odd, MessageChannel is defined in the polyfill. If you can share a repro case as a repo I can take a look.