Remix deployment publishes but edge function provides error

I’m trying to deploy a new Remix site.

The url is
The build itself goes fine, but after the deployment, when I try to visit it I get the following error:

The deployment failed while serving the request.

When I look at the logs it shows:

1:51:53 PM: ReferenceError: __default is not defined
    at netlify:bundle-combined:8382:15

I traced this back to the .netlify/edge-functions-dist/ which has one hashed file. At the bottom of this file, is the following line:

const functions = {
    "server": __default

However there is no __default anywhere in the file. Any ideas what is going wrong in my build that the edge function is trying to reference a non-existent error?

Hi @EdwardHinkle,

We’ve seen this problem in the past, but it appeared to be a user error back then. We’ve escalated this to the developers again to re-check this issue. We’ll let you know as we’ve more details.

1 Like

Hi Edward! Simon from the Edge Functions Dev team here :wave: The URL you shared seems to work fine, and that site’s current edge functions bundle also doesn’t look like it’d throw the __default is not defined error. Were you able to fix this? If yes, how did you fix it?

1 Like

I spun up a new empty version of the package. It seems like there’s something wrong with my other repos configuration. I had started with one remix stack that allowed me to get mdx support and things like that, but it was built to deploy to vercel. So then I tried to copy files from the netlify edge stack into it, but I’m either missing something or something is misconfigured.

So instead, it seems that I need to start with the netlify edge stack and then figure out what dependencies I need to install to get the MDX stuff working.

Thanks for looking into this! From what I did the last couple of days it seems like it’s user error

Hey there, @EdwardHinkle :wave:

Thanks so much for coming back and sharing this update with us. Don’t hesitate to come back if you encounter more questions along the way.

Happy building!