QwikDev / qwik

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

[🐞] Multiple rewrites paths casuing a RegExp error #6375

Closed shairez closed 5 months ago

shairez commented 5 months ago

Which component is affected?

Qwik City (routing)

Describe the bug

For some reason, defining the same path 3 times causes the rewrite routes function to throw

I've already added a test to the core that proves that and I'm going to fix it

Reproduction

not relevant

Steps to reproduce

for the following configuration of the qwik-city vite plugin:

rewriteRoutes: [
    {
      prefix: 'de',
      paths: {
        produkt: 'produkt',
      },
    },
    {
      prefix: 'no',
      paths: {
        produkt: 'produkt',
      },
    },
    {
      prefix: 'fi',
      paths: {
        produkt: 'tuote',
      },
    },
  ],

The rewriteRoutes function throws an error

System Info

not relevant

Additional Information

No response

shairez commented 5 months ago

fixed by #6377