Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change with <Trans> component in version 12.1.0 #1634

Closed
fromi opened this issue Apr 24, 2023 · 4 comments
Closed

Breaking change with <Trans> component in version 12.1.0 #1634

fromi opened this issue Apr 24, 2023 · 4 comments

Comments

@fromi
Copy link
Contributor

fromi commented Apr 24, 2023

🐛 Bug Report

When I upgrade to react-i18next v12.1.0 or superior (up to current version 12.2.1), I have this error using the component:
Uncaught Error: Trans(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.

To Reproduce

This repository contains a simple way to reproduce the issue: https://github.com/gamepark/board-game-template

  1. Checkout the code
  2. Run yarn install & yarn start: see the header text : "Hello Red player" (or blue, green...)
  3. Go to app/package.json and upgrade react-i18next dependency to `"react-i18next": "^12.1.0"``(instead of 12.0.0)
  4. repeat step 2, the app will crash and the error will appear in the console.

Expected behavior

No breaking change in minor versions 😅

Your Environment

  • runtime version: node v16.17.1
  • i18next version: i18next v22.0.3, react-i18next v12.1.0 or superior
  • os: Windows
@adrai
Copy link
Member

adrai commented Apr 24, 2023

seems like, it loads 2 different react-i18next modules, the commonjs one and the es one... but the question is why?

@adrai
Copy link
Member

adrai commented Apr 24, 2023

it picks this conditional export for require...

"require": "./dist/commonjs/index.js"

but why?

@adrai
Copy link
Member

adrai commented Apr 24, 2023

try with react-i18next v12.2.2

@fromi
Copy link
Contributor Author

fromi commented Apr 24, 2023

It works! Thanks a lot for the quick fix ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants