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
[NEXT-947] The experimental-runtime fails with ReferenceError: self is not defined when used inside a route group #43458
Comments
Currently the generated matcher will be `"regexp": "^\(group\)/group$"` for groups which doesn't match the correct route. This is somehow related to #43458, but it only fixes the problem partially. Some other changes need to be made in the build process. ## Bug - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
#43662 - my example was the /pages/index.tsx , and i dont see that is covered in the senarie mentioned here so why is it a dublicate? |
people are reporting issues on #43662 that is not related to route groups. As i see it , fetch do not work in edge runtime. |
I just got the error on 13.1.1, not in a route group. Just /test/[name]. |
fails with the same message "ReferenceError: self is not defined" on windows for nested pages even now, yet build works fine if you do it on linux (ubuntu) even though all packages and binaries are the same version as windows (even when updating both to next@canary latest I guess it is some sort of path issue that doesnt resolve in windows but resolves fine in linux |
Getting this on deploying to vercel on 13.2.4 |
This ensures we use the correct short name when generating edge functions with route groups from app directory. Example deployment with fix can be seen here https://next-debug-edge-runtime-1ar7agbjh-vtest314-ijjk-testing.vercel.app/group-no-layout Fixes: vercel/next.js#43458
Hi, this should now be available in production, please re-deploy your project and give it a try! |
Did a rebuild of my draft PR using the Edge for one page (in a route group). It just started working! |
I also rebuild my projects that previously failed with 500 error. Now they are working fine. Thanks! |
This closed issue has been automatically locked because it had no new activity for a month. 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
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
Using the
experimental-edge
runtime fails with the following error when used inside a route group.Given the following file structure:
With
export const runtime = "experimental-edge"
, the following is observed:/
- Works/nested
- Works/group
- Fails/another-group
- FailsI checked if having a
layout.tsx
has any effect on grouping. It does not.Expected Behavior
Expects the
experimental-edge
runtime to work inside route groups.Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://github.com/shadcn/next-debug-edge-runtime
To Reproduce
See the links below:
experimental-edge
runtime works for root page: https://next-debug-edge-runtime.vercel.appexperimental-edge
runtime works for a nested page: https://next-debug-edge-runtime.vercel.app/nested-with-layoutexperimental-edge
runtime does not work for a grouped page with layout: https://next-debug-edge-runtime.vercel.app/group-no-layoutexperimental-edge
runtime does not work for a grouped page without layout: https://next-debug-edge-runtime.vercel.app/group-with-layoutNEXT-947
The text was updated successfully, but these errors were encountered: