-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
🐛 BUG: react component + client:load
fails with preact/compat
but works fine with @astrojs/react
#4107
Comments
I'll take this too! Blocked by #4093 |
I believe #4213 should fix this too. I saw the same error while making the test and can confirm it's fixed with the PR. |
it looks like this problem is still happening on #4093 also seems to be still broken. |
I was able to get dev working by specifying I'd agree that it's a bit cumbersome, but I actually found a nicer workflow using this suggestion. I'll re-open this PR, so we can suggest using |
Well turns out the build fails because now |
@mayank99 I added docs in #4267 which hopefully clarifies things a bit. From the repro here and at #4093. The build is still failing as:
|
@bluwy Thank you so much for looking into this. Do you think from this point on, these issues should be reported to the respective packages? Since they seem to be using incorrect imports |
Yeah the packages above are built for bundlers only, and not very friendly in nodejs, so it may be worth opening an issue on the respective packages. Those should be out of scope of Astro/Vite as it's a nodejs behaviour. |
I had the same issue trying to use Material UI (MUI) components. It seems like they have the same issue with incorrectly exporting ESM (https://publint.bjornlu.com/@mui/material@5.10.0) and have a Draft PR to fix this, but probably in the next major (mui/material-ui#30510).
and Later edit: Actually for some reason this workaround only works for |
hello, I am still experiencing this issue on Astro 4.2.8, is this an issue with preact-compat? |
What version of
astro
are you using?1.0.0-rc.3
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Windows / Stackblitz
Describe the Bug
I have a
ComboBox
component fromreact-aria
that I'm trying to render withclient:load
using the@astrojs/preact
adapter with{ compat: true }
. It gives me the following error:Using
client:load='preact'
works fine so I believe this is an SSR issue. However, I noticed that swapping outpreact({ compat: true })
with justreact()
makes it work withclient:load
again.(I did also come across #3306, but this is
react-aria
notreact-spectrum
(which is a styled wrapper aroundreact-aria
) so there is no CSS involved. This could be why it works fine on server withreact()
.)Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-xkptsr?file=src%2Fpages%2Findex.astro,astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: