Skip to content

Hydration error for rendered Elements that aren't inserted in the DOM during server rendering #1977

@GiyoMoon

Description

@GiyoMoon

Describe the bug

SolidJS produces hydration errors when resolving children that aren't attached to the DOM.

Picture this:

const Component = (props) => {
  const resolvedChildren = children(() => props.children)
  return <Show when={false}>{resolvedChildren()}</Show>
}

Here, the children resolve but aren't attached to the actual DOM and it throws a hydration error.

Your Example Website or App

https://github.com/GiyoMoon/solid-hydration-error

Steps to Reproduce the Bug or Issue

  1. pnpm install
  2. pnpm dev
  3. go to localhost:3000
  4. see hydration error

Expected behavior

This shouldn't throw a hydation error.

Screenshots or Videos

No response

Platform

Solid 1.8.7
SolidStart 0.3.10

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions