-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Dynamic pages with uncertain paths #1005
Comments
I was having the exact same issue. I was also skipping the static generation by returning {
"pageProps": {
"_nextI18Next": {
"initialI18nStore": {
"en": {
"common": {},
"footer": {}
}
},
"initialLocale": "en",
"userConfig": {
}
}
},
"__N_SSG": true
} I already created a reproduction case based on the next-i18next sample: |
Meanwhile, I moved back to next 10.0.5 and nextjs-i18next 7.0.0 |
@TKone7 I don't see any issues with the repo you've linked at all. What you seem to be observing is the fallback page behaviour. If I add this to your if (isFallback) {
return null
} The behaviour seems a bit more acceptable. Are you aware of how fallback and fallback page replacement works? It sounds like what you're after is probably SSR, via @pablohpsilva Also, my suggestion is to either use fallback the way it was intended, or use SSR. Let me know if I can help in any other way! |
Hi @isaachinman, thanks a lot for your response. I am affraid, I think I explained myself not clearly. I adapted the repo to make it clear. Repro: https://repro-dynamic-routing-tkone7.vercel.app/blog/blog-post When you visit the url
I did a little more analysis of the working of the function |
@TKone7 That again sounds like the fault of whichever serverless platform you are using. You will need to ensure that your locale data remains in the filesystem. |
Thanks for that hint, @isaachinman. const path = require('path')
module.exports = {
ns: ['common', 'footer', 'second-page'],
i18n: {
defaultLocale: 'en',
locales: ['en', 'de'],
},
localePath: path.resolve('./public/locales')
}
|
I have this problem in |
1 similar comment
I have this problem in |
Describe the bug
Currently, I have dynamic routes that should follow the pattern:
/client/[id]/edit
I honestly don't know what
[id]
is here. I can't predict them. Therefore, usingwill force me to use
But I have no idea what
paths
can be. If I change it to something likepaths: ['/client/*/edit']
or any variation to make*
part a wildcard, nextjs will complain that itError: ReactDOMServer does not yet support Suspense.
(obviously).My question is: how can I go around this issue? I honestly don't want to have SSG (this is expected by business and it is fine), but I want to use translations.
Occurs in next-i18next version
"next-i18next": "^8.0.2"
Steps to reproduce
I am considering this repository's basic setup was made (README was followed).
Create a page like:
pages/[id]/index.tsx
As a sample, use the following page component:
Now, if you run the very basic nextjs-typescript project, nextjs will complaint it can't generate the static paths, because there are none. But, also, I don't really care about the paths, since they are dynamically coming from BE.
Expected behaviour
To work without the SSG option
The text was updated successfully, but these errors were encountered: