Skip to content

2.0.0-beta.14: Rejected SSR lazy() renders stack overflow instead of reaching Errored #2780

Description

@yumemi-thomas

Describe the bug

In Solid 2.0.0-beta.14, a rejected server-side lazy() component under <Loading> and <Errored> does not render the error boundary fallback.

Instead, the original lazy rejection appears as a process-level unhandledRejection. In my local run, the rendered SSR output also serialized a RangeError: Maximum call stack size exceeded, but the core issue is independent of that exact symptom: the rejected lazy module does not reach <Errored> as lazy failed.

Your Example Website or App

https://stackblitz.com/edit/solidjs-templates-rxaw9heg?file=src%2Fentry-server.tsx

Steps to Reproduce the Bug or Issue

  1. Open the StackBlitz terminal.
  2. Run npm run repro.
  3. Inspect the rendered output.
  4. Observe that the output does not contain the <Errored> fallback.
  5. Observe that the original lazy failed rejection is logged as an unhandled rejection.

Expected behavior

The rejected lazy module should be handled as an error.

Because the tree has an <Errored> boundary, expected output should include:

error: lazy failed

At minimum, SSR should fail/report cleanly with the original lazy failed error. It should not leak the original lazy rejection as a process-level unhandledRejection.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Runtime: Node.js
  • Version: Solid 2.0.0-beta.14

Additional context

The likely issue is that server lazy() records only the fulfilled module:

p.then(mod => {
  p.v = mod.default;
});

The render path then keeps checking:

if (!p.v) throw new NotReadyError(p);

If the Promise rejects, there is no stored rejection state, so the server can continue treating the lazy component as pending/retryable instead of converting it into an error. Locally, that produced stack overflow serialization plus an unhandled rejection; in any case, the stable bug is that the rejection does not reach <Errored>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions