#Can I please get an i18n tutorial for Astro that actually works?

6 messages · Page 1 of 1 (latest)

twin verge
#

I've tried using astro-i18n and astro-i18next, and both of them don't seem to work for me, and that's mainly cus there's proper tutorial to understand them. Please help me out.

granite prairie
twin verge
#

It's throws errors

#

I tried cloning this repo https://github.com/totti-rdz/astro-i18next-demo and running it and it throws this error

 error   Cannot find module 'i18next' imported from 'astro:scripts/page-ssr.js'
  File:
    D:\POC\astro-i18next-demo\D:\POC\astro-i18next-demo\D:\POC\astro-i18next-demo\node_modules\.pnpm\vite@3.2.7\node_modules\vite\dist\node\chunks\dep-2faf2534.js:53393:25
  Stacktrace:
Error: Cannot find module 'i18next' imported from 'astro:scripts/page-ssr.js'
    at viteResolve (file:///D:/POC/astro-i18next-demo/node_modules/.pnpm/vite@3.2.7/node_modules/vite/dist/node/chunks/dep-2faf2534.js:53393:25)
    at nodeImport (file:///D:/POC/astro-i18next-demo/node_modules/.pnpm/vite@3.2.7/node_modules/vite/dist/node/chunks/dep-2faf2534.js:53430:15)
    at ssrImport (file:///D:/POC/astro-i18next-demo/node_modules/.pnpm/vite@3.2.7/node_modules/vite/dist/node/chunks/dep-2faf2534.js:53318:20)
    at eval (astro:scripts/page-ssr.js:3:50)
    at instantiateModule (file:///D:/POC/astro-i18next-demo/node_modules/.pnpm/vite@3.2.7/node_modules/vite/dist/node/chunks/dep-2faf2534.js:53364:15)
GitHub

Contribute to totti-rdz/astro-i18next-demo development by creating an account on GitHub.

granite prairie
#

that's weird, it works fine for me, can you try to delete the node_modules folder and reinstall it with npm i?

exotic sable
#

i18next is not the same as i18n of the tutorial afaik.