#Can I please get an i18n tutorial for Astro that actually works?
6 messages · Page 1 of 1 (latest)
Doesn't this documentation work for you? https://docs.astro.build/en/recipes/i18n/
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)
that's weird, it works fine for me, can you try to delete the node_modules folder and reinstall it with npm i?
i18next is not the same as i18n of the tutorial afaik.