This Edge Function has crashed.
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
I am getting a
The problem seems to be with the middleware (https://github.com/MystenLabs/walrus-sites/blob/develop/portal/server/middleware.ts) I am using.
From the deployment logs I see the following (
This would make sense if I called
What could be the cause?
500: INTERNAL SERVER ERROR - This Edge Function has crashed. for my nextjs deployment on vercel. The problem seems to be with the middleware (https://github.com/MystenLabs/walrus-sites/blob/develop/portal/server/middleware.ts) I am using.
From the deployment logs I see the following (
__dirname is not defined): ReferenceError: __dirname is not defined
at (portal/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1/node_modules/next/dist/compiled/ua-parser-js/ua-parser.js:1:17315)
at (portal/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1/node_modules/next/dist/compiled/ua-parser-js/ua-parser.js:1:17444)
at (portal/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1/node_modules/next/dist/server/web/spec-extension/user-agent.js:27:59)
at (portal/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1/node_modules/next/server.js:8:0)
at (portal/server/middleware.js:3:29)This would make sense if I called
__dirname in my middleware, or if I imported a third party that does so, but this is not the case.What could be the cause?