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-1013] (...)[dynamic] does not work #48143
Comments
It would help if you could deploy this! |
@shawshankkumar Good idea. I just did! |
@feedthejim Can you take a look at this one as well? I also have an issue with this one. |
on the latest canary? |
@feedthejim I have just updated the deployed reproduction to canary.6 https://intercept-route-test.vercel.app/en/foo/bar/baz |
thanks for the repro @sandervspl, will investigate |
When looking into this with routes as below, I found that the interception route is never used. Instead it always uses the normal {
"/[language]/[id]/page": "/[language]/[id]",
"/[language]/@modal/(.)[id]/page": "/[language]/(.)[id]"
} So the problem likely lies in the route matching area. An interception segment should get priority over a normal dynamic segment. Hope this helps @feedthejim |
Attached is a patch with a partial workaround for this issue. It's for |
I also observed that having just dynamic |
### What? Paths with interception markers adjacent to dynamic segments are not correctly parsed, which leads to the path match logic failing. ### Why? `getParametrizedRoutes` checks for brackets but isn't expecting to receive an interception marker. For example, a path of `/photos/(.)[author]/[id]` results in the following regex: `/^\/photos\/\(\.\)\[author\]\/([^/]+?)(?:\/)?$/` This will not match a path of `/photos/(.)zack/1` since it retained the `[author]` brackets. `getSegmentParam` has a similar issue when getting values for path params, though we can just skip the interception markers and go straight to the params. Closes NEXT-1166, NEXT-1013 Fixes #48143 Fixes #49614 link NEXT-1013
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
$ next info Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 Binaries: Node: 18.12.1 npm: 8.19.2 Yarn: 1.22.19 pnpm: 8.1.1 Relevant packages: next: 13.3.1-canary.3 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://github.com/sandervspl/intercept-route-test/
To Reproduce
Show user
I am a REGULAR user page
Describe the Bug
You can not use a dynamic parameter with parallel routes, e.g.
(...)[locale]
Expected Behavior
It should show a page with the text
User INTERCEPT page
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1013
The text was updated successfully, but these errors were encountered: