Skip to content

"Failed to instantiate edge runtime.fig:load:flatten", "__dirname is not defined" #225

Closed
@cheapsteak

Description

@cheapsteak

Bug Report

Current behavior

Created a blank project to test middleware

Server starts up fine
> Success! Build completediming config:load:flatten Completed in 3ms
> Ready! Available at http://localhost:3000

but upon accessing localhost:3000, the page returns "This Edge Function has crashed", and the console logs

Failed to instantiate edge runtime.fig:load:flatten Completed in 3ms
__dirname is not defined

Expected behavior/code

The middleware function to run instead of returning page crash

Possible solution

Additional context/screenshots
Repro by running npm run ddev

Archive.zip

I don't believe this is a duplicate of #209 since I've tried running with node@16.19.0 and also downgrading to a version of vercel cli that was using edge-runtime@1.1.0 and received the same errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions