-
Notifications
You must be signed in to change notification settings - Fork 26.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_error is treated as a serverless function even though the edge runtime is specified (in Pages) #48490
Comments
Any progress on this issue? We are facing a similar issue. Here is our
Build error:
|
Any updates? |
Any chance you will review this? |
I have the same issue, but my app is using app routing. When I used previous nextjs version 13.4.19, it worked well. So, you'd better use previous version like 13.4.19 while they are fixing it. I just hope this problem be fixed soon. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 Binaries: Node: 16.16.0 npm: 8.11.0 Yarn: 1.22.15 pnpm: 6.11.0 Relevant packages: next: 13.3.1-canary.9 eslint-config-next: 13.3.0 react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue
https://github.com/dario-piotrowicz/nextjs-_error-edge-demo
To Reproduce
Run
npm run build
and view the.next/server/middleware-manifest.json
fileDescribe the Bug
the
_error
is not present in the middleware manifest thus it is being treated as a serverless function instead of an edge route, basically ignoring the user provided configExpected Behavior
_error
should be present as a field of the functions object inside the middleware manifest thus it will be deployed as an edge route as requested by the user provided configAdditional Information
Seems like this only happens with the Pages routing, App routing seems to be fine
By looking at the Vercel cli source code (specifically here) it looks to me like the way of discerning if a function is a serverless one or an edge one is to check their presence in the middleware manifest, so I based the details above on this assumption
Regardless on the middleware manifest I noticed the issue when running
![Screenshot 2023-04-17 at 14 34 21](https://user-images.githubusercontent.com/61631103/232540590-a0bc0be6-76f9-4006-bc9b-fef90710bc8e.png)
vercel build
since, as you can see from the following screenshot generates a node serverless function instead of an edge one:The text was updated successfully, but these errors were encountered: