next-translate icon indicating copy to clipboard operation
next-translate copied to clipboard

Server components support (next 12)

Open emmekappa opened this issue 3 years ago • 2 comments

Any plan for supporting React Server Components introduced in next12? https://nextjs.org/blog/next-12#react-server-components

emmekappa avatar Nov 10 '21 12:11 emmekappa

I didn't know that next-translate didn't work in Server Components... I haven't even tried it. So there was no plan because I didn't know it didn't work. What is the error @emmekappa? Thanks!

aralroca avatar Nov 10 '21 12:11 aralroca

Error: You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps

I tried using next 12 with react 18 beta, chakra-ui, and next-translate the other day, and ran into some problems. I got frustrated with it before testing next-translate without chakra-ui, and revert back to react 17.

next-translate - compiled page: / - locale: en - namespaces: navbar, home - used loader: getStaticProps

I noticed next-translate uses getStaticProps, and wonder if that was causing the issue for me. From what I've read, you cannot use things such as getStaticProps in the server. I don't know well enough about the subject, but thought it might be good to leave a couple of words here.

jasonkarjadi avatar Nov 19 '21 05:11 jasonkarjadi

Already supported in 2.0 😊

aralroca avatar Feb 23 '23 09:02 aralroca