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

interpolatedString seems undefined #166

Closed florian-lefebvre closed 8 months ago

florian-lefebvre commented 1 year ago

Describe the bug

When running pnpm dev, I get the following:

D:/somefolder/node_modules/.pnpm/astro-i18next@1.0.0-beta.21_astro@2.6.3/node_modules/astro-i18next/src/utils.ts:59
    interpolatedString = interpolatedString.replaceAll(
                                            ^

TypeError: Cannot read properties of undefined (reading 'replaceAll')

To Reproduce

Steps to reproduce the behavior:

  1. Create an astro project with pnpm
  2. Add astro-18next and setup
  3. Run pnpm dev
  4. See error

Expected behavior

Shouldn't crash

Context (please complete the following information):

estebanprimost commented 12 months ago

Same problem here using <Trans /> component. @florian-lefebvre did you find any solution? Thanks.

florian-lefebvre commented 12 months ago

No I was trying to migrate an existing project and gave up

florian-lefebvre commented 11 months ago

I'm not using the Trans component anymore so I could migrate to pnpm but still, no solution here

fruchtzwerg commented 11 months ago

Seems like its incompatible with i18next v23.x.x. Downgrading to v22 resolved the issue for me.

santi020k commented 8 months ago

If it helps anyone: If you install react-i18next, it uses version 23 by default and breaks this library, with this same error, the solution is to set the i18next version to the latest compatible version, in my case it was:

     "i18next": "22.4.10",

And change react-i18next version

     "react-i18next": "^12.3.1",