robisim74 / qwik-speak

Translate your Qwik apps into any language
https://robisim74.gitbook.io/qwik-speak/
MIT License
131 stars 15 forks source link

`localizePath()` for "/" causes `Invalid URL` error in preview mode or production. #129

Open genki opened 2 months ago

genki commented 2 months ago

When I get the localized path for the root path "/" and use it for nav(), it is no problems at dev server, but it causes error Invalid URL in preview mode or production environment.

genki commented 2 months ago

I found the localized path for the "/" is resolved to "//" when the app runs in production mode.

Here's a workaround:

const getPath = localizePath();
export const usePath = (path:string) => {
  const gotPath = getPath(path);
  if (gotPath === "//") return "/";
  return gotPath;
}
robisim74 commented 2 months ago

I am unable to recreate this issue. Could you post the SpeakConfig or otherwise provide some other details? Thank you