react icon indicating copy to clipboard operation
react copied to clipboard

[Compiler Bug]: A bug with i18n translation after react compiler

Open YYGod0120 opened this issue 1 year ago • 3 comments

What kind of issue is this?

  • [X] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
  • [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin)
  • [ ] eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
  • [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://github.com/YYGod0120/yyblog

Repro steps

  1. Change the var in app/[language]/components/Typewrite.tsx to const (use var to skip the compiler and fix the bug)
  2. use pnpm dev to start project
  3. Click twice on the lanswitcher and find that the Banner is not translated after the second click.

How often does this bug happen?

Every time

What version of React are you using?

v19.0.0-rc-3f1436cca1-20240516

YYGod0120 avatar May 21 '24 11:05 YYGod0120

#15038 involves i18n and deals with errors caused by instantiating i18next when dynamically combining multiple applications. Though the descriptions vary slightly, both issues revolve around i18n and potential related problems. There might be some common patterns or issues among them.

testhowtest avatar May 23 '24 06:05 testhowtest

#15038 involves i18n and deals with errors caused by instantiating i18next when dynamically combining multiple applications. Though the descriptions vary slightly, both issues revolve around i18n and potential related problems. There might be some common patterns or issues among them.

Thank you for your advise. I don't know if it's a problem with i18n or react-compiler. After I skipped compile, the display was normal and I didn't see any errors. So I prefer it to be a compiler problem.

YYGod0120 avatar May 25 '24 06:05 YYGod0120

By the way, I moved the problem to the branch of compilerBug. I bypassed this problem on the main branch and updated it.

YYGod0120 avatar May 25 '24 06:05 YYGod0120