Skip to content

[Bug?]: ErrorBoundary not working in nested (children) layouts #1677

@PawelJastrzebski

Description

@PawelJastrzebski

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

ErrorBoundary not catch error in children node.

export function PageLayout({ children }: { children?: JSXElement }) {

    return (
        <ErrorBoundary fallback={<div>Error PageLayout</div>} >
            {children}
        </ErrorBoundary>
    )
}

Expected behavior 🤔

should catch error like in this case: Pass by props.

export function PageLayoutWorks({ children }: { children: () => JSXElement }) {

    return (
        <ErrorBoundary fallback={<div>Error PageLayoutWorks</div>} >
            {children()}
        </ErrorBoundary>
    )
}

Steps to reproduce 🕹

Full Example: https://github.com/PawelJastrzebski/solidStart_error_boundry

Context 🔦

Catch errors on page Layout level.

I'm not sure if this supposed to work on the children level, or is it not working on children level by design?

Your environment 🌎

Node: v20.18.0
Npm: 10.8.2

OS: Ubuntu 24.04 noble
Kernel: x86_64 Linux 6.8.0-48-generic

"dependencies": {
  "@solidjs/meta": "^0.29.4",
  "@solidjs/router": "^0.15.0",
  "@solidjs/start": "^1.0.10",
  "solid-js": "^1.9.2",
  "vinxi": "^0.4.3"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions