-
Notifications
You must be signed in to change notification settings - Fork 4
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
Circular JSON issue when using withHydration
#34
Comments
I think this is due to a change introduced in v1.0. Should be fixed when we update the plugin to support the new API. |
i think i also saw it on 0.12.1, but fine if it's fixed for 1.0 only |
Ah okay, in that case we'll probably just want to have a better error message here and maybe have some escape hatch that allows you to filter out data from other plugins. Only interactive components should have serialized props, so at some point it's up to the user to work around the limitations introduced by that pattern (i.e. props must only contain serializable properties). The intended use-case here is for a mostly static site that has some interactivity sprinkled in, rather than a server-side rendered full-page progressive web app. If that's the end goal, I think some other tools might be better suited towards those goals. As a workaround, a user could have a top-level static Page component that only passes through serializable data to a hydrated App component that renders the entire body of the page. I think this would be preferable anyway, since including all of Eleventy's data as serialized props is a lot of bloat on the page. |
that makes perfect sense, thanks for looking into it! i'd appreciate some way to filter props for hydration |
Eleventy Version: 0.12.1 or 1.0
When using
withHydration
on a layout component, I get this error:I was able to track this to the
collections
prop that is passed to all layout components. It seems to include circular references.Consider removing the circular references before serializing the state for hydrated components.
The text was updated successfully, but these errors were encountered: