-
Notifications
You must be signed in to change notification settings - Fork 660
Tried to cast node with kind JS_STRING_LITERAL_EXPRESSION as AnyJsxAttributeValue #4639
Comments
@fubhy could you please replicate the issue and share it with us? We can't really help you without a way to understand how you triggered the issue |
The project I am in has thousands of files. I have no idea which file is causing this and it would take quite some time to narrow it down manually. Is there a way for rome to output the name of the file it blew up on? |
@fubhy
|
If it can help, that error is likely coming from a JSX file. |
Will do that on monday and report back. Thanks! |
Found the culprit ... This JSX code triggers the exception: return <MyComponent label={<>Some label in a fragment</>} /> Now... Why this was written in this way, I don't know. And it's not necessary, so I removed it. But it's technically valid code so shouldn't throw imho. |
How did you trigger the error? That's an information you missed in the original description. The playground doesn't trigger any issue |
I can't trigger it in the playground either. But it consistently errors out when running the cli with |
Then it's probably triggered by some lint rule with a code action that emits an invalid AST, and this AST gets passed to some other rule, and it blows. Having a repro will surely help us! |
The repro is basically just running But np, here it is: https://github.com/fubhy/rome-bug-repro |
Environment information
What happened?
Expected result
It shouldn't throw ;-)
Btw. it would be easier to debug if the error included the name of the file.
Code of Conduct
The text was updated successfully, but these errors were encountered: