Closed Sathyaraj-dev closed 3 months ago
If you are trying to use static export, it will not work with this library. Since this library is dependent on middleware, static export is not supported. You can read more here: https://nextjs.org/docs/app/building-your-application/deploying/static-exports
For best performance using next-i18n-router, it is recommended to use generateStaticParams
with your supported locales as seen in our example: https://github.com/i18nexus/next-i18n-router/blob/main/examples/i18next-example/app/%5Blocale%5D/layout.tsx#L15
I am already using generateStaticParams, but all the pages are still coming through as dynamic. Please see the screenshot below for reference.
Could you please check if there are any issues in the code? Any help would be greatly appreciated.
Thanks.
Can you try running our example project and seeing if it works for you as expected? https://github.com/i18nexus/next-i18n-router/tree/main/examples/i18next-example
Thanks for the clarification. It's working fine now. The issue was on my side due to adding a timestamp in the fetch API. I appreciate the quick response!
Thanks again.
Before implementing the i18next, react-i18next, i18next-resources-to-backend, and next-i18n-router packages, all my pages were being prerendered as static content. However, after incorporating these packages, all the pages are now rendered as SSG (using getStaticProps), and they are not being cached.
Is there a solution to maintain static rendering and caching while using these packages? Any advice or guidance would be greatly appreciated.
Thanks,