QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.7k stars 1.29k forks source link

[🐞] Bug while using rewrite routes pointing to the same file #6799

Open fprl opened 1 month ago

fprl commented 1 month ago

Which component is affected?

Qwik Runtime

Describe the bug

Hey everyone, do you know how to solve this issue when needing duplicated rewrite routes pointing to the same file? I upgraded my site to > 1.7.2 and can't build it:

More than one route has been found for pathname "..."

I thought this was already solved in v.1.5.6, in fix(qwikcity): duplicated rewrite routes with multiple prefixes by @shairez in #6377.

Thank you!

Reproduction

https://github.com/fprl/qwik-duplicated-pathname-route

Steps to reproduce

npm run build and you will see the error.

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1
    Memory: 64.39 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.0.0 - ~/.nvm/versions/node/v22.0.0/bin/node
    Yarn: 3.6.3 - /usr/local/bin/yarn
    npm: 10.5.1 - ~/.nvm/versions/node/v22.0.0/bin/npm
    pnpm: 8.12.1 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 127.0.6533.120
    Safari: 17.5
  npmPackages:
    @builder.io/qwik: ^1.8.0 => 1.8.0 
    @builder.io/qwik-city: ^1.8.0 => 1.8.0 
    typescript: 5.4.5 => 5.4.5 
    undici: * => 6.19.7 
    vite: 5.3.5 => 5.3.5

Additional Information

No response

JerryWu1234 commented 1 month ago

image image

I don't why it different between DEV and PRO. image

secondly, paths is an necessary property, I guess image

@shairez Please help check this.

is paths in RewriteRouteOption an necessary property?

JerryWu1234 commented 1 month ago

the only thing left is that when paths is empty, it can run in DEV mode, but PRO can't not. we have to make DEV and PRO behave consistently

JerryWu1234 commented 1 month ago

@wmertens CC

fprl commented 4 weeks ago

@JerryWu1234 any clue on where's the issue? I could try to solve it but if you have a hint it will be easier :)

wmertens commented 4 weeks ago

I haven't really looked at the routing code yet, maybe @shairez knows

shairez commented 4 weeks ago

Thanks for checking this @JerryWu1234 !

I'll look into solving this after we'll fix the overfetching issue