500 Error with Next-intl Middleware on Vercel Deployment: EDGE_FUNCTION_INVOCATION_FAILED #74609
-
Link to the code that reproduces this issuehttps://github.com/Zakisb/aimplifyy To ReproduceEncountering a server-side error when deploying a Next.js 14 application with next-intl middleware to Vercel. The deployment fails with a 500 status code, specifically citing EDGE_FUNCTION_INVOCATION_FAILED as the reason. Additionally, a ReferenceError: __dirname is not defined occurs within the ua-parser-js module, as well as in the user-agent and middleware files of next-intl. This error is not present during local development and only manifests upon deployment to Vercel. Note that previously i worked with next-intl and deployed without a problem. i don't know if it's something to do with the latest next 14 version or next-intl Current vs. Expected behaviorI expected the web app to be deployed. Currently it's crashing Verify canary release
Provide environment informationOperating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103
Binaries:
Node: 18.18.0
npm: 9.8.1
Yarn: 1.22.11
pnpm: N/A
Relevant Packages:
next: 14.0.1
eslint-config-next: 14.0.0
react: 18.2.0
react-dom: 18.2.0
typescript: 5.2.2
Next.js Config:
output: N/A Which area(s) are affected? (Select all that apply)Middleware / Edge (API routes, runtime) Additional contextWorks fine locally. |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
I am having same issue as well |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
@Zakisb Thank you for sharing! I currently receive an error when attempting to build your
|
Beta Was this translation helpful? Give feedback.
-
For me, I ended up having to upgrade from the free tier to the paid tier on the number of Vercel functions. |
Beta Was this translation helpful? Give feedback.
-
@MichaelWalker-git Are you referring to this Serverless Function limit → https://vercel.com/docs/functions/serverless-functions/runtimes#functions-created-per-deployment (separate behavior from above, which is referring to an Edge Function error). |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
I had the same issue. I set up different projects to try to pinpoint the problem. I noticed my faulty project had the wrong "Build & Development Settings" in the project settings on Vercel. It was set to "other" instead of "Next.js", which caused it to build differently with Can you verify if these settings are set to "NextJS"? Switching it to "NextJS" did the trick for me. |
Beta Was this translation helpful? Give feedback.
-
@RobinDeNeef This did the trick for me as well :) |
Beta Was this translation helpful? Give feedback.
-
That fixed it for me as well. Thanks man! |
Beta Was this translation helpful? Give feedback.
-
This fixed it for me. Thanks man |
Beta Was this translation helpful? Give feedback.
-
This thread is proof to start with Google before spending [redacted amount of time] arguing with an LLM. |
Beta Was this translation helpful? Give feedback.
I had the same issue. I set up different projects to try to pinpoint the problem.
I noticed my faulty project had the wrong "Build & Development Settings" in the project settings on Vercel.
It was set to "other" instead of "Next.js", which caused it to build differently with
npm run vercel-build
.Can you verify if these settings are set to "NextJS"? Switching it to "NextJS" did the trick for me.