Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
genki opened this issue Jun 17, 2024 · 2 comments
Labels
question Further information is requested

Comments

@genki
Copy link

genki commented Jun 17, 2024

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
Copy link
Author

genki commented Jun 17, 2024

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
Copy link
Owner

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

@robisim74 robisim74 added the question Further information is requested label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants