Admin routes being matched by Intercepting Routes
Unanswered
Bonga shad posted this in #help-forum
Bonga shadOP
I’m having some issues that seem to have started after introducing Intercepting Routes.
Problems
Navigation from /shop/admin to /products or /categories does not work.
When I click a link, it instantly redirects me back.
However, if I open these pages via a direct URL, they load correctly.
When navigating to /shop/admin/TEST, it opens the page from /shop/[category]/[product].
Is this expected behavior?
After some “magical” actions, everything suddenly starts working and pages open correctly, but then I start getting errors like this:
⨯ Error: Invalid interception route: /shop/(.)(.)admin/products.
Must be in the format:
/<intercepting route>/(..|...)/<intercepted route>
Context
Using App Router
Using parallel routes with @modal
Using Intercepting Routes for product modals inside the shop
Here is my current folder structure:
apps/web/src/app/shop$ tree -L 4
├── (main)
│ ├── @modal
│ │ ├── (.)[category]
│ │ │ └── [product]
│ │ └── page.tsx
│ ├── [category]
│ │ ├── [product]
│ │ │ └── page.tsx
│ │ └── page.tsx
│ ├── layout.tsx
│ └── page.tsx
└── admin
├── categories
│ ├── [categoryId]
│ │ └── page.tsx
│ ├── add
│ │ └── page.tsx
│ └── page.tsx
├── layout.tsx
├── page.tsx
└── products
├── [productId]
│ └── page.tsx
├── add
│ └── page.tsx
├── page.tsx
I’m trying to understand:
Why admin routes are being intercepted by /shop/[category]/[product]
Why client-side navigation breaks, but direct access works
Whether this folder structure is valid or if intercepting routes are leaking outside of their intended scope
Any clarification on what I’m doing wrong or how intercepting routes are supposed to be isolated would be greatly appreciated 🙏
Problems
Navigation from /shop/admin to /products or /categories does not work.
When I click a link, it instantly redirects me back.
However, if I open these pages via a direct URL, they load correctly.
When navigating to /shop/admin/TEST, it opens the page from /shop/[category]/[product].
Is this expected behavior?
After some “magical” actions, everything suddenly starts working and pages open correctly, but then I start getting errors like this:
⨯ Error: Invalid interception route: /shop/(.)(.)admin/products.
Must be in the format:
/<intercepting route>/(..|...)/<intercepted route>
Context
Using App Router
Using parallel routes with @modal
Using Intercepting Routes for product modals inside the shop
Here is my current folder structure:
apps/web/src/app/shop$ tree -L 4
├── (main)
│ ├── @modal
│ │ ├── (.)[category]
│ │ │ └── [product]
│ │ └── page.tsx
│ ├── [category]
│ │ ├── [product]
│ │ │ └── page.tsx
│ │ └── page.tsx
│ ├── layout.tsx
│ └── page.tsx
└── admin
├── categories
│ ├── [categoryId]
│ │ └── page.tsx
│ ├── add
│ │ └── page.tsx
│ └── page.tsx
├── layout.tsx
├── page.tsx
└── products
├── [productId]
│ └── page.tsx
├── add
│ └── page.tsx
├── page.tsx
I’m trying to understand:
Why admin routes are being intercepted by /shop/[category]/[product]
Why client-side navigation breaks, but direct access works
Whether this folder structure is valid or if intercepting routes are leaking outside of their intended scope
Any clarification on what I’m doing wrong or how intercepting routes are supposed to be isolated would be greatly appreciated 🙏