Skip to content
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

Routers Catch all routs is blocking defined routs #1059

Open
2 tasks
alexcibotari opened this issue Apr 25, 2024 · 0 comments
Open
2 tasks

Routers Catch all routs is blocking defined routs #1059

alexcibotari opened this issue Apr 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@alexcibotari
Copy link

alexcibotari commented Apr 25, 2024

Please provide the environment you discovered this bug in.

https://stackblitz.com/edit/github-nzwggh?file=src%2Fapp%2Fpages%2Findex.page.ts

Which area/package is the issue in?

router

Description

I have :

src/
└── app/
    └── pages/
        ├── (slug)/
        │   └── [...slug].page.ts
        ├── docs/
        │   └── [...slug].page.ts
        ├── (slug).page.ts
        ├── docs.page.ts
        └── index.page.ts

Please provide the exception or error you saw

I expect that the docs/.... requests will be handled by the folder docs.page.ts layout and /docs/[...slug].page.ts page router, as catch-all routs should have lower priority.

But all pages will be handled by (slug).page.ts layout and /(slug)/[...slug].page.ts page router.

If I change it, it will work, but I lose Layout

src/
└── app/
    └── pages/
        ├── docs/
        │   └── [...slug].page.ts
        ├── [...slug].page.ts
        ├── docs.page.ts
        └── index.page.ts

Other information

I have a proposal to have another type of file that will specify the Layout exactly as Pages *.layout.ts
Examples :

src/
└── app/
    └── pages/
        ├── docs/
        │   ├── [...slug].layout.ts
        │   └── [...slug].page.ts
        ├── [...slug].page.ts
        ├── [...slug].layout.ts
        └── index.page.ts

In this way, the route will be able to have multiple repeatable layouts tree

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@alexcibotari alexcibotari added the bug Something isn't working label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant