[Compiler Bug]: React compiler not working with babel 8 - throws (BuildHIR::lowerAssignment) Expected object property value to be an LVal, got: AssignmentPattern
Author: hariabinesh-l-4219Created Jun 24, 2026Updated Sep 17, 2026
LabelsType: BugStatus: Unconfirmed
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
https://github.com/hariabinesh-l-4219/react-compiler-babel-8-issue
Repro steps
[Compiler] CompileError: /Users/hari-4219/Git/react-compiler-babel-8-issue/badge.jsx
_CompilerError [ReactCompilerError]: Found 1 error:
Todo: (BuildHIR::lowerAssignment) Expected object property value to be an LVal, got: AssignmentPattern
1 | export const Badge = ({
> 2 | variant = "primary",
| ^^^^^^^^^^^^^^^^^^^ (BuildHIR::lowerAssignment) Expected object property value to be an LVal, got: AssignmentPattern
3 | ...rest
4 | }) => {
5 | const className = `badge badge-${variant}`;
at new HIRBuilder (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:76126:19)
at lower (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:78097:19)
at runWithEnvironment (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:106368:15)
at run (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:106361:10)
at compileFn (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:106689:10)
at tryCompileFunction (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:107289:19)
at processFn (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:107226:25)
at compileProgram (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:107107:22)
at PluginPass.enter (/Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/babel-plugin-react-compiler/dist/index.js:108443:28)
at newFn (file:///Users/hari-4219/Git/react-compiler-babel-8-issue/node_modules/@babel/traverse/lib/index.js:484:14) {
details: [ CompilerErrorDetail { options: [Object] } ],
disabledDetails: [],
printedMessage: 'Found 1 error:\n' +
'\n' +
'Todo: (BuildHIR::lowerAssignment) Expected object property value to be an LVal, got: AssignmentPattern\n' +
'\n' +
' 1 | export const Badge = ({\n' +
'> 2 | variant = "primary",\n' +
' | ^^^^^^^^^^^^^^^^^^^ (BuildHIR::lowerAssignment) Expected object property value to be an LVal, got: AssignmentPattern\n' +
' 3 | ...rest\n' +
' 4 | }) => {\n' +
' 5 | const className = `badge badge-${variant}`;',
code: 'BABEL_TRANSFORM_ERROR'
}
Possible solution: Lval check needs additional isPatternLike check as per babel docs. https://babeljs.io/docs/v8-migration-api
How often does this bug happen?
Every time
What version of React are you using?
19.2.4
What version of React Compiler are you using?
1.0.0
Source: facebook/react