How to handle SSR
See original GitHub issueI really like this library, but I have some problems getting it to work as I like using SSR (with nextjs).
Basically, what I want is to render only the messages of the requested locale and have SSR do it’s work.
Using Nextjs I can use a getInitialProps
function, but the data is required to be serializable and that’s where the problem comes in; the compiled bundles contain pluralization functionality.
I think my three options are:
- ignore pluralization
- include all messages on the client (I don’t want to do this)
- include the pluralization library in the client
Am I missing something? Any help/ideas would be appreciated.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Logging and error management best practices in SSR apps
Handling SSR errors on the server side · Catching errors in data fetchers · Error status codes · Redirect to error pages ·...
Read more >Server-Side Rendering (SSR) - Vue.js
Teleports require special handling during SSR. If the rendered app contains Teleports, the teleported content will not be part of the rendered string....
Read more >A beginner's guide to React Server-Side Rendering (SSR)
In this lesson, we are going to talk about server-side rendering (SSR), its benefits, and its pitfalls. Then we will set up a...
Read more >What is server-side rendering and how does it improve site ...
Server-side rendering (SSR) addresses the performance and search engine optimization issues of single-page JavaScript applications.
Read more >Server-Side Rendering - Vite
Vite provides built-in support for server-side rendering (SSR). ... When building an SSR app, you likely want to have full control over your...
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 FreeTop 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
Top GitHub Comments
Just checking in here, looks like this is still an issue with this lib and it does not handle SSR and SSG on nextjs? Will try it out myself when I get a chance.
I have been using lingui with nextjs on https://fantaasta.com and I can get it to SSG pages with the default locale, but translations are done client-side. Ideally translated pages should be SSG too.
This is my setup: