Open mraerino opened 2 years ago
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.