QuiiBz / next-international

Type-safe internationalization (i18n) for Next.js
https://next-international.vercel.app
MIT License
1.25k stars 59 forks source link

is I18nProvider block the SEO? #235

Closed mamlzy closed 10 months ago

mamlzy commented 10 months ago

Describe the bug i'm using pages directory. after i'm wrapping my app with I18nProvider, the SEO is gone, when i see the page source, i just got an empty div, but if i remove the I18nProvider i got the full html. Can you give me explanation about this? thanks.

Screenshots

  1. with I18nProvider image
  2. without image

About (please complete the following information):

QuiiBz commented 10 months ago

See the Static Site Generation documentation here: https://next-international.vercel.app/docs/pages-static-site-generation

You have to use getStaticProps or getServerSideProps to SSR the initial page. See also the example here: https://github.com/QuiiBz/next-international/blob/62fe48b48f423d6183e4d41ea863a37fe7fe48d2/examples/next-pages/pages/ssr-ssg.tsx#L4