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

[Playground Bug]: Unexpected token, expected "{" #31601

Open
1 of 5 tasks
gkiely opened this issue Nov 21, 2024 · 4 comments · May be fixed by #31792
Open
1 of 5 tasks

[Playground Bug]: Unexpected token, expected "{" #31601

gkiely opened this issue Nov 21, 2024 · 4 comments · May be fixed by #31792

Comments

@gkiely
Copy link

gkiely commented Nov 21, 2024

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)
  • Playground issue

Link to repro

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAejQAgPIAcEB2mcEBkANgpgIYEAmmUBJAti4QC4A6BGxpYDpgCiMGAEZMAXkwAKAJTSAfJgA8dAJYA3TGiUBuHnxJkhomACZpcxVJWz123UvmHeWE4JFiAzNcc6ejxGWAAqABYaYJgA7hAwANbRAGYaBAgh-KaYAMLWCsqYwJmYmDAIHLBEAc6ZAL4gdUA

Repro steps

Any component created without curly braces will create an error in the console no compiler output is shown.

See playground link.

How often does this bug happen?

Every time

What version of React are you using?

react@rc

What version of React Compiler are you using?

19.0.0-beta-8a03594-20241020

@gkiely gkiely added Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug labels Nov 21, 2024
@josephsavona josephsavona changed the title [Compiler Bug]: Unexpected token, expected "{" [Playground Bug]: Unexpected token, expected "{" Nov 21, 2024
@josephsavona josephsavona removed the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Nov 21, 2024
@aalmanasir

This comment was marked as off-topic.

@aalmanasir

This comment was marked as off-topic.

@dimaMachina
Copy link

dimaMachina commented Dec 15, 2024

After my first contribution to react-compiler, I wanted to fix this too, but it seems already fixed?
image

I tried to install [email protected] or 0.0.0-experimental-ba7b8e5-20241213 which is out 2 days ago and on my project arrow function with implicit return are still not optimized, do you know @josephsavona which version include this fix? or maybe there is some option to pass to reactCompilerConfig?

@dimaMachina
Copy link

dimaMachina commented Dec 15, 2024

ok, I found why I couldn't see optimized components with implicit returns, setting ReactCompilerConfig.compilationMode: 'all' makes them optimized

update

So I consider this as a still a bug since compilationMode: 'infer' doesn't optimize components with implicit returns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants