-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Astro JSX Bug - Property body of ArrowFunctionExpression expected node to be of a type ["BlockStatement","Expression"] but instead got "ExpressionStatement" #7499
Comments
From a bit of messing around the issue seems to consistently happen when you have a For example, the following is working: function Demo() {
return <head></head>;
}
function DemoWrapper() {
return <NoHydration><Demo /></NoHydration>
} But this causes the bug to come back: function DemoWrapper() {
return <NoHydration><head></head></NoHydration>
} |
@ematipico could be a good one for you to grab if you have the time. |
This seems to be an issue in our compiler. I am going to move the issue there |
Here's what the compiler emits: return $$render`function DemoWrapper() ${
return "something"}`;
}, '<stdin>');
export default $$stdin; Which is not valid code You can view the playground |
IIUC |
Yeah, it looks like this is a problem with Either way, this is a JSX bug so I'm moving this issue back from the compiler repo. |
I looked into this again and the stacktrace seems to be coming from Good news though, it looks like simply updating to |
What version of
astro
are you using?^2.3.0
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Mac (my machine) or Stackblitz
What browser are you using?
Chrome
Describe the Bug
With the following code, you encounter an error from
astro:jsx
as attached below. I am using SolidJS with Astro.Error:
Reveal full error
I traced the error back to the existence of the
NoHydrate
component inindex.ts
. The error says it was sourced fromastro:jsx
so I am reporting it here.I also noticed that the error only happens when
client:load
'ing the file, the file seems to be fine for SSR'ing.It looks like it's nothing special with the
NoHydrate
component from SolidJS and replacing it with any custom JSX component will reproduce the same bug.I would love to help with a PR but this might be a bit out of my depth.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/astro-searrp?file=src/components/index.tsx
Participation
The text was updated successfully, but these errors were encountered: