qwik icon indicating copy to clipboard operation
qwik copied to clipboard

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

Open fprl opened this issue 1 year ago • 7 comments

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](https://github.com/QwikDev/qwik/releases/ tag/v1.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

fprl avatar Aug 16 '24 07:08 fprl

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 avatar Aug 20 '24 03:08 JerryWu1234

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 avatar Aug 20 '24 03:08 JerryWu1234

@wmertens CC

JerryWu1234 avatar Aug 26 '24 01:08 JerryWu1234

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

fprl avatar Aug 29 '24 20:08 fprl

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

wmertens avatar Aug 29 '24 21:08 wmertens

Thanks for checking this @JerryWu1234 !

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

shairez avatar Aug 30 '24 11:08 shairez

Thanks for checking this @JerryWu1234 !

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

I know the problem where it is. But there are lot of ways we can fix it, in my opinion, we can throw an error if didn't pass path

@shairez

JerryWu1234 avatar Oct 08 '24 01:10 JerryWu1234

looks like this was fixed in #6970 so closing

good job @JerryWu1234 ! 🙏

shairez avatar Jan 22 '25 12:01 shairez