SSR called on every page change with getInitialProps
See original GitHub issueWhat version of this package are you using? v1.5.0
What operating system, Node.js, and npm version? Node v16.13.2, Next v12.1.6 (tried v12.3.0 too)
What happened? After building the nextjs app, when navigating between routes (even static ones), the ssr is always called and does a refresh on the front. My _app is using getInitialProps.
next-translate - compiled page: /integrations/integrations - locale: en - namespaces: common - used loader: getInitialProps
My current configuration :
module.exports = {
locales: ["en", "fr"],
defaultLocale: "en",
pages: {
"*": ["common"],
},
keySeparator: false,
nsSeparator: false,
defaultNS: "common",
};
I’m not using any provider, just the basic config in next.config.js. If I remove the nextTranslate from next.config.js, it change the route only on the client side.
What did you expect to happen? The compilation is called only on the first render, then the client handle the translation.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
getInitialProps - Data Fetching - Next.js
getInitialProps enables server-side rendering in a page and allows you to do initial data population, it means sending the page with the data...
Read more >What is Next.js getInitialProps and getServerSideProps? | refine
getServerSideProps is an asynchronous function used in Next.js pages component for server-side rendering and works almost the same as ...
Read more >getInitialProps vs. getServerSideProps in Next.js
Explore the differences between getInitialProps and getServerSideProps, two methods for defining props for server-side rendered pages.
Read more >Is there a method that runs only once server-side on first page ...
I'm new to next.js and I'm looking for a method (similar to getServerSideProps ) that runs just once on the server.
Read more >Why I Got Rid of getInitialProps in My Next.js Project
In Next.js, getInitialProps enables server-side rendering and can't be statically optimized. It runs every time we open a page. If a page is ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey @aralroca! Let me try to do that! Also, I’m using next-routes, I don’t know if it can be linked.
Follow-up on this issue. It seems that it was linked to next-routes and express, I removed both from the app and now it works!