Skip to content

[Bug]: react-i18next provider not available in plugins #13698

@leobenzol

Description

@leobenzol

Package.json file

fresh 2.10.3 backend and plugin starters

Node.js version

v22.13.1

Database and its version

PostgreSQL 17.2

Operating system name and version

macOS

Browser name

No response

What happended?

the "react-i18next" package is not marked as external in the admin-bundler. This means that plugins use a second instance of i18n that is never initialized.
It is currently not possible to use translations already provided by medusa in custom plugins(for example all the strings in a data table: pagination, search, filter, sort, create button etc)

I've added a reproduction repo below(just for convenience, since the plugin starter is quite old) with a minimal test page

Steps:

  • [backend] setup the database, seed and create user
  • [plugin] npx medusa plugin:developor npx medusa plugin:publish
  • [backend]npx medusa plugin:add my-medusa-plugin && yarn && rm -rf node_modules/.vite/deps && yarn dev

Solution:
Adding "react-i18next" in these 2 places:

Expected behavior

the strings provided by the dashboard should be available

Actual behavior

they aren't

Link to reproduction repo

https://github.com/leobenzol/test-plugin-providers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions