-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Fail to match a request path to its app route if using basePath on edge runtime #49661
Comments
We are hitting this too. This effectively makes |
Same -- we're running into this currently while trying to generate open graph images (we use app directory and |
Fixes a bug where the edge runtime didn't support `basePath` with Custom App Routes. - Fixes #49661
I have exact same error but without using
couldn't find any documentation for why this doesn't work! leaving this comment just in case someone stumbles on this problem too. What worked for me was disabling |
also running into this |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023 Binaries: Node: 18.16.0 npm: 9.5.1 Yarn: 1.22.19 pnpm: 8.4.0 Relevant packages: next: 13.4.2-canary.5 eslint-config-next: 13.4.1 react: 18.2.0 react-dom: 18.2.0 typescript: 5.0.4
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Middleware / Edge (API routes, runtime), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/repro-basepath-for-routes-rzyh8z?file=%2Fapp%2FSendRequest.tsx%3A13%2C84
To Reproduce
Load the sandbox. The preview should show an error 500. The server logs show:
Describe the Bug
What happens behind the scene:
"/mysubpath"
)"/mysubpath/api"
, which errors.But if the route runtime is set back to the default (comment
runtime = "edge"
), it works as expected.The file
node_modules/next/dist/esm/server/web/edge-route-module-wrapper.js
seems to be related to the issue. The basePath does not seem to be used there, so the URL path and the route matcher don't match.Expected Behavior
Fetching the routes works with a basePath and the edge runtime without error.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: