You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
on_render: wrapping the hook's result in another component fails when nested #173
This works when Inner renders on its own. When Inner is used inside another component's template, turning the page into HTML raises:
RuntimeError: The same rendered component id was encountered more than once during serialization
On interactive pages it fails even when Inner is the outermost component. The on_render docstring and docs/design/component_on_render.md suggest passing the result around like this is supported.
Cause
The hook's result is still marked as Inner's own output. When Frame embeds it, Inner's id appears twice in the tree: once for the new output and once nested inside Frame. _append_frame_parts in serialize.py (about lines 994-1003) compares a child's id only with its immediate parent's, so the nested copy gets the same placeholder key, and the duplicate check in build_frames (serialize.py:709) raises. At the top level the outer copy uses the root key, so only one copy is checked, which is why it works when rendered alone.
Fix direction
Serialization needs to tell the two copies apart (the hook's earlier result versus the component's final output) on both the static and the Vue paths, and decide which component's scoped-CSS marker the embedded content gets.
Workaround
Wrap in the template where the component is used (<c-Frame><c-Inner /></c-Frame>), as /advanced/hooks/ shows.
Activity