Repository navigation
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.0.0: Fri Aug 18 00:02:20 PDT 2023; root:xnu-10002.1.11~5/RELEASE_ARM64_T8103
Binaries:
Node: 18.17.1
npm: 9.6.7
Yarn: 1.22.19
pnpm: 8.7.0
Relevant Packages:
next: 13.4.20-canary.9
eslint-config-next: 13.4.19
react: 18.2.0
react-dom: 18.2.0
typescript: 5.2.2
Next.js Config:
output: N/AWhich area(s) of Next.js are affected? (leave empty if unsure)
App Router
Link to the code that reproduces this issue or a replay of the bug
https://github.com/shiroyasha9/teensy/tree/feature/migrate-to-next13
To Reproduce
- Clone the repo and ensure that the branch is
migrate-to-next13 - Populate .env using the .env.example (any string values can be entered for
GOOGLE_ID,GOOGLE_SECRET,NEXTAUTH_SECRETandSECRET_KEYto test out the bug) pnpm ifollowed bypnpm dev- From the index page, click the login button on the top right. Expected behaviour is that it will be intercepted and open as a modal. However, it opens as a separate URL.
Describe the Bug
So I followed the official tutorial provided for using parallel routes and intercepting routes together to create an experience where if the user clicks on sign in while being on a page, it opens up as a modal overlaying the previous page, otherwise when being navigated to the page directly it loads as a separate page.
The weird thing is that the same code works on a different repo, and also the nextgram example. However in this project, the route simply does not get intercepted. Below attached is the screenshot for the log that appears when navigating to it using the login button

I have tried the canary releases, downgrading to the version of next that was used in nextgram example, even copy pasting the nextgram example code here. But none of the routes seem to be ever intercepted. I thought the pages router might be conflicting (I am in a middle of a migration to app router), so I even tried deleting it, but to no avail.
To check the deployed version, please check this link https://teensy-3n9c0y53y-shiroyasha9.vercel.app/
Video of the current behaviour, if that helps
https://github.com/vercel/next.js/assets/48734821/17d63fcd-ada0-4500-a77c-325841ffd922
Would love some help on this topic, thanks a lot
Expected Behavior
The /login route should have been intercepted and opened as a modal, instead of going to the standalone route.
Which browser are you using? (if relevant)
Arc Version 1.5.0 (41058) Chromium Engine Version 116.0.5845.110
How are you deploying your application? (if relevant)
Vercel

Activity
danjiro commentedon Aug 28, 2023
try adding a layout.tsx in (auth) that renders props.auth
shiroyasha9 commentedon Aug 28, 2023
This does not work, as it says it is not a valid layout prop in that folder. I have added a layout.tsx in the root directory which renders the authModal. As I said, I had used the same exact code in a different repo, and there everything works. It is just in this project that I am facing this issue.
shiroyasha9 commentedon Aug 28, 2023
Wow, okay so this is weird
I was able to make this work by removing the following lines from my
next.config.js.I am not sure how this was affecting the interception of the route, and would love some explanation on it, thanks!
baufometic commentedon Oct 6, 2023
Temporary workaround that fixed it for me in VSCode:
Note that I have TypeScript 5.2.2 installed as a project dev dependency, as well as 5.2.2 as the VSCode version.
renovatt commentedon Nov 3, 2023
"next": "13.4.19",
I'm facing a slightly strange problem, I don't know if I'm missing something.
I have a project that is already working normally, the dynamic routes together with route interception, everything is ok. The folder structure is as follows:

link: https://portfolio-renovatt.vercel.app/views/projects
Note: the route is being intercepted, the background remains the same.
But I'm trying to use hidden routes,
(views), putting them in parentheses, and following the same structure, following the same pattern, route interception doesn't work correctly.An error occurs where the original route and the intercepted route are called together.
I changed the structures a few times and found these two repositories, which I found in other issues:
#49614
https://github.com/vetledv/repro-intercept/blob/main/src/app/(some-group)/%40modal/(.)photos/%5Bid%5D/page.tsx
https://github.com/Apestein/nextflix/blob/main/src/app/(main)/%40modal/(.)show/%5Bid%5D/page.tsx
They are doing it like this, placing
@modalinside(main), but when I do this, the route appears in the URL , however the screen is not changed, in this case my component does not appear, but if I update the page the original route happens, but just by placing(views)as the parent folder, the intercepted route happens, but with the same error as before , where the original route and the intercepted route are called together.I don't understand why this happens, can anyone help me?
renovatt commentedon Nov 7, 2023
I managed to fix this problem, solution:
I created the parallel route
@modaloutside the hidden route(views)and just placed the dynamic route following the same path, directly, without saying that it is inside the(views)route, this way it will actually be intercepted, this way I can normally call it/project/id.I tested several ways, and I saw that calling the
@modalroute inside the(views)route was calling both routes at the same time, and the other way was calling the route but the component was not being used intercepted.I hope this can help others with the same problem.


github-actions commentedon Jan 12, 2024
We cannot easily recreate the issue with the provided information. Please add a minimal reproduction in order for us to be able to help more efficiently.
Why was this issue marked with the
please simplify reproductionlabel?There was a reproduction provided, but due to its complexity, we cannot easily reproduce the issue.
An ideal minimal reproduction (unless relevant):
next@canaryto make sure your issue has not already been fixedIn general, assume that we should not go through a lengthy onboarding process at your company code only to be able to verify an issue.
If you cannot create a clean reproduction, another way you can help the maintainers' job is to pinpoint the
canaryversion ofnextthat introduced the issue. Check out our releases, and try to find the firstcanaryrelease that introduced the issue. This will help us narrow down the scope of the issue, and possibly point to the PR/code change that introduced it. You can install a specific version ofnextby runningnpm install next@<version>.What happens if I don't provide a sufficient minimal reproduction?
Issues with the
please simplify reproductionlabel that receive no meaningful activity (e.g. new comments with a simplified reproduction link) are automatically closed and locked after 30 days.If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.
I did not open this issue, but it is relevant to me, what can I do to help?
Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps.
I think my reproduction is good enough, why aren't you looking into it quicker?
We look into every Next.js issue and constantly monitor open issues for new comments.
However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.
Providing a minimal reproduction from the start without asking helps us look into issues much more quickly, as we can easily verify if the reported bug is related to Next.js. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.
Useful Resources
remib18 commentedon Jan 13, 2024
From my understanding, this issue is related to route groups and intercepting routes. It seems the route groups are causing the router to ignore the interception. I tried to remove the group and it worked.
TechSynthesis commentedon Feb 15, 2024
@remib18 have you found any fix for this?
balazsorban44 commentedon Mar 21, 2024
This issue has been automatically closed because it received no activity for a month and had no reproduction to investigate. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.
github-actions commentedon Apr 5, 2024
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.