QwikDev/qwik

[๐Ÿž] Route is broken with deep nesting

mhuretski opened this issue ยท 4 comments

Which component is affected?

Qwik City (routing)

Describe the bug

Hi,

When using [...lang] catchall route at the root of the routing, deeply nested routes are broken if lang is not provided.

src/routes/[...lang]/
    โ”‚
    โ”œโ”€โ”€ (app)/
    โ”‚   โ”œโ”€โ”€ index.tsx
    โ”‚   โ””โ”€โ”€ layout.tsx
    โ”‚
    โ”œโ”€โ”€ some/
    โ”‚   โ””โ”€โ”€ deep/
    โ”‚       โ””โ”€โ”€ nested/
    โ”‚           โ”œโ”€โ”€ [id]/
    โ”‚           โ”‚   โ””โ”€โ”€ index.tsx (broken without "lang")
    โ”‚           โ””โ”€โ”€ index.tsx
    โ”‚
    โ””โ”€โ”€ working/
        โ””โ”€โ”€ nesting/
            โ””โ”€โ”€ [id]/
                โ””โ”€โ”€ index.tsx

/some/deep/nested/some_id - broken
/some_lang/some/deep/nested/some_id - OK
/some/deep/nested - OK
/some_lang/some/deep/nested - OK
/working/nesting/some_id - OK
/some_lang/working/nesting/some_id - OK

Catchall route doesn't seem to be a great fit as an optional route, perhaps adding something like [?lang] could simplify routing logic with deep nesting to avoid this issue?

Reproduction

https://stackblitz.com/edit/qwik-starter-q65fv9?file=src%2Froutes%2F%5B...lang%5D%2F(app)%2Findex.tsx

Steps to reproduce

No response

System Info

"@builder.io/qwik": "^1.5.4",
"@builder.io/qwik-city": "^1.5.4",

Additional Information

No response

may I pick this up ?

may I pick this up ?

Go for it ๐Ÿ‘ Thanks

maybe it can directly close this Issue?

oh yeah this was fixed in 1.5.5