#Groud groups and intercepting routes
1 messages · Page 1 of 1 (latest)
Hi @golden peak. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the extracts provided, it seems you're encountering a known issue with Next.js regarding intercepting routes within grouped routes. This issue has been discussed in several GitHub issues, with users experiencing similar problems when trying to implement route interception within route groups.
One key point mentioned is the necessity of having a default.tsx file within the group that contains the interception. Although the official Next.js documentation does not explicitly mention this requirement, it has been observed in practice and noted by users in the community. For example, a user in GitHub Issue #52386 (https://github.com/vercel/next.js/issues/52386) pointed out that looking at an example, a default.tsx file was created inside the group, suggesting this might be an expected behavior or a workaround for the issue.
Another user in the same issue thread described a scenario where the original route and the intercepted route are called together, indicating a problem with route interception not working correctly when using hidden routes (routes within parentheses) and following a specific structure.
Furthermore, a contributor mentioned in GitHub Issue #48104 (https://github.com/vercel/next.js/issues/48104) that they had to look over the e2e tests in Next.js to find out that you need default.tsx to fix a 404 error, which aligns with the workaround mentioned above.
While there was an attempt to address some related issues, as seen in a pull request mentioned by a contributor (GitHub PR #48276 (https://github.com/vercel/next.js/pull/48276)), it seems there might still be unresolved problems specifically with interception within modal routes.
Given this context, if you're facing issues with intercepting routes within grouped routes, you might want to ensure you have a default.tsx file in your group that requires interception. Additionally, it could be beneficial to follow the discussions on the mentioned GitHub issues and any related pull requests for updates or more specific workarounds.
Unfortunately, without more specific details about your implementation and the exact structure of your route groups, it's challenging to provide a more tailored solution. However, these insights from the GitHub issues should offer some direction on how to approach the problem.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@golden peak kapa.ai is still learning and improving, please let us know how it did by reacting below
So my folder structure is:
app
(main-app)
(..)space-board
space-board
How to properly use reference the space-board route
@upper swift
So my folder structure is:
app
(main-app)
(..)space-board
space-board
How to properly use reference the space-board route
Let me check the knowledge base for you. One moment! :books:
Based on the information provided in the extracts, it seems you're trying to navigate the intricacies of Next.js routing, specifically around the concepts of route groups, private folders, and intercepting routes. However, the specific scenario you've described—using a folder structure to reference a space-board route within a grouped and intercepted context—doesn't directly match the examples provided in the extracts.
To clarify, the extracts mention several routing conventions in Next.js, such as:
- Route Groups and Private Folders: Using
(folder)to group routes without affecting routing and_folderto opt a folder and all child segments out of routing. Source (https://nextjs.org/docs/app/building-your-application/routing/route-groups#convention) - Intercepting Routes: Using patterns like
@folderfor named slots,(.)folderto intercept at the same level, and(...)folderto intercept from the root. Source (https://nextjs.org/docs/app/building-your-application/routing/intercepting-routes#convention)
Given these conventions, if your goal is to reference the space-board route within a grouped and intercepted context, you might be looking to either group routes together without affecting their routing paths or intercept certain routes based on your application's logic.
However, without a direct extract matching your scenario of using (..)space-board within a route group, it's challenging to provide a precise answer on how to properly reference the space-board route in your described folder structure.
For a more detailed understanding and guidance, I recommend reviewing the official Next.js documentation on Routing (https://nextjs.org/docs/routing/introduction) and Dynamic Routes (https://nextjs.org/docs/routing/dynamic-routes), as these sections might offer insights into advanced routing techniques that align with your requirements.