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

SSR and DSG pages include language twice inside matchPath #162

Open
denisgoryaynov opened this issue Nov 3, 2022 · 0 comments
Open

SSR and DSG pages include language twice inside matchPath #162

denisgoryaynov opened this issue Nov 3, 2022 · 0 comments

Comments

@denisgoryaynov
Copy link

I have some SSR routes that use getServerData to fetch some data, for example src/pages/products/[slug].tsx

These pages work correctly for the default language but for other language they contain the language twice, for example the component mentioned above becomes: /fr/fr/products/:slug

The expected behaviour would be for the page to be reachable at /fr/products/:slug, but it is not happening because this line of code duplicates the language:

localePage.matchPath = `/${lng}${localePage.matchPath}`;

Removing the entire if condition fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant