-
Notifications
You must be signed in to change notification settings - Fork 49.8k
Description
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-compiler (build issue installing or using the eslint plugin)
- react-compiler-healthcheck (build issue installing or using the healthcheck script)
Link to repro
Update: Repro 2 (much smaller)
Repro steps
In the playground link, the code produces two errors (bolding mine):
Memoization: Compilation skipped because existing memoization could not be preserved
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency wasconvertedValue...
[same text] The inferred dependency was
t3...
This is weird:
convertedValueis a variable inside useMemo. It should not and cannot be inuseMemo()dependenciest3is one of the temporary variables Compiler creates. It should not be exposed to the user at all
Funnily, changing the useMemo code even a bit results in completely different variable names being reported (three errors this time: t3, t5 and t6).
(Unsure if this is a reporting issue for an otherwise valid deopt or a genuine invalid deopt.)
How often does this bug happen?
Every time
What version of React are you using?
19.1.1
What version of React Compiler are you using?
19.1.0-rc.2