-
-
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
🐛 BUG: Hydrated components exported via JS break prod builds #3217
Comments
.astro
files exported via JS break prod builds
.astro
files exported via JS break prod builds
This is part of a larger issue library maintainers are running into. Specifically, if you have a package that needs to export components via named exports: // my-library/components
export TemplateWithComponents from './TemplateWithComponents.astro'
export Dynamic from './Dynamic.jsx' ...any clientside JS used will fail. This includes script tags (#3134) and third party component libraries (#2182). @benjaminbarbe for your issue specifically, I'd advice against exporting |
As you just closed some other related bugs and mentioned that you were collecting your efforts here, I thought I should add something I mentioned a while ago on Discord: The re-exporting issues do not only affect client-side JS code. They also affect CSS during development. If the re-exported external In |
Do you have another way to do it? For the moment, the only workaround I found is indeed to import directly and thus duplicate my code. Thanks |
I don’t believe there’s a workaround currently (apart from importing directly), and we’ll need to wait for a fix. This issue has been labelled |
|
What version of
astro
are you using?1.0.0-beta.17
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
Related to: #3134
When I deactivate the partial hydration the exception is no longer raised in production build.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-uydp8r?file=src%2Fpages%2F[...test]%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: