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

[Compiler Bug]: return without value causes bailout #32620

Open
1 of 4 tasks
aeharding opened this issue Mar 15, 2025 · 2 comments
Open
1 of 4 tasks

[Compiler Bug]: return without value causes bailout #32620

aeharding opened this issue Mar 15, 2025 · 2 comments
Labels
Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug

Comments

@aeharding
Copy link

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

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAsgJ4DCEAtgA6EKY4AUAlEcADrFFyFg5eACwRwA1kQC8RKGAQBBWrQDKCADaicEGM2YCAhjgTtJAPiIBCCwaOsA3N25EieNEWYW4I8exgIcsJgOmE5EfgEwxADkQnhRwQC+3CAJQA

Repro steps

I noticed that return without a value (e.g. return vs return undefined) causes compiler to bailout. Please see the below examples:

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAsgJ4DCEAtgA6EKY4AUAlEcADrFFyFg5eACwRwA1kQC8RKGAQBBWrQDKCADaicEGM2YCAhjgTtJAPiIBCCwaOsA3N25EieNEWYW4I8exgIcsJgOmE5EfgEwxADkQnhRwQC+3CAJQA

vs

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAsgJ4DCEAtgA6EKY4AUAlEcADrFFyFg5eACwRwA1kQC8RKGAQBBWrQDKCADaicEGM2YCAhjgTtJAPiIBCCwaOsA3N25EieNEWYW4I8exgIcsMRYACYIaHiYCMEOmE5EfgEwxADkQnjJMQC+3CCZQA

prior discussion: reactwg/react-compiler#61

How often does this bug happen?

Every time

What version of React are you using?

0.0.0-experimental-6aa8254b-20250312

What version of React Compiler are you using?

0.0.0-experimental-ecdd742-20250312

@aeharding aeharding added Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug labels Mar 15, 2025
@scato3
Copy link

scato3 commented Mar 15, 2025

can i fix it?

@suhaotian
Copy link

It's component, should always return something, for eaxmple: return null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants