[Compiler Bug]: `Invariant: [InferMutationAliasingEffects] Expected value kind to be initialized` on passing reference to current function to other function
オープン
まだ誰も着手していません。
Status: Unconfirmed
Type: Bug
- 主要言語
- JavaScript
- スター
- 251k
- フォーク
- 51.4k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 53
説明
What kind of issue is this?
- 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-hooks (build issue installing or using the eslint plugin)
- react-compiler-healthcheck (build issue installing or using the healthcheck script)
Link to repro
Repro steps
1: give react compiler this code
export function MyComponent() {
return <HelloWorld onClick={() => {
foo(function bar() {
if (Math.random() > .5) {
baz();
} else {
qux(bar);
}
});
}} />
}
2: notice the following error
Found 1 error:
Invariant: [InferMutationAliasingEffects] Expected value kind to be initialized
<unknown> bar$5.
5 | baz();
6 | } else {
> 7 | qux(bar);
| ^^^ this is uninitialized
8 | }
9 | });
10 | }} />
How often does this bug happen?
Every time
What version of React are you using?
the version in playground.react.dev
What version of React Compiler are you using?
the version in playground.react.dev
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされている React Compiler playground から始め、JavaScript スニペットを使ってエラーを再現します。qux(bar) 参照で発生する [InferMutationAliasingEffects] の失敗を追跡し、その後、同じ再現で未初期化値や不変条件エラーが報告されなくなったことを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- compilers, frontend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100