yassinedoghri / astro-i18next

An astro integration of i18next + some utility components to help you translate your astro websites!
https://astro-i18next.yassinedoghri.com
MIT License
473 stars 33 forks source link

Cannot find module 'i18next' imported from 'astro:scripts/page-ssr.js' #152

Open andycansdale opened 1 year ago

andycansdale commented 1 year ago

Describe the bug

Dependencies are not found when using pnpm

Cannot find module 'i18next' imported from 'astro:scripts/page-ssr.js' Cannot find module 'i18next-fs-backend' imported from 'astro:scripts/page-ssr.js'

To Reproduce

Steps to reproduce the behavior:

  1. Install Astro with pnpm create astro@latest
  2. Install astro-i18next with pnpm add astro-i18next
  3. Add configuration exactly as documented.
  4. Run the application pnpm run dev

Expected behavior

The modules should been found in this library's dependencies.

Possible fixes

The error can be fixed by manually adding both modules to the project. pnpm add i18next pnpm add i18next-fs-backend

I'm new to pnpm so I don't know if perhaps I'm missing something there. I would expect the modules to be resolved from this library's dependencies as they are present in package.json.

jpkhawam commented 1 year ago

I also have this issue with pnpm (pnpm, astro and dependencies up to date). Adding i18next and i18next-fs-backend also fixed it for me