Skip to content

fix: surface errors from lazily loaded route modules instead of hanging the SSR stream - #2259

Closed
birkskyum wants to merge 4 commits into
solidjs:mainfrom
birkskyum:fix-syntax-error-overlay
Closed

fix: surface errors from lazily loaded route modules instead of hanging the SSR stream#2259
birkskyum wants to merge 4 commits into
solidjs:mainfrom
birkskyum:fix-syntax-error-overlay

Conversation

@birkskyum

Copy link
Copy Markdown
Member

A syntax error in a route (or anything it imports) left the browser on a blank page with no error shown anywhere.

Every file route loads through lazy(). When the module fails to transform, its dynamic import rejects, and Solid's server-side lazy has no rejection path:

p = fn();
p.then(mod => p.resolved = mod.default);   // no .catch

So _loading stays true, the Suspense boundary never resolves, and renderToStream never closes. The document shell is flushed and the connection then hangs open forever, which is also why no Vite overlay appears: as far as the browser is concerned the page loaded fine.

withAssets already wraps the import on the server for asset collection, so this catches the rejection there and returns a module that throws during render. Solid routes that through catchError to the nearest ErrorBoundary, i.e. the dev overlay. Also covers a lazy chunk failing to load in production, which hung the stream the same way.

Errors in eagerly imported files (app.tsx, entry-server.tsx) were already handled and are unchanged.

Verified on apps/fixtures/basic with a broken component:

before after
load page while broken request never completes, blank page 500, dev overlay shows the SyntaxError

Added lazy.spec.ts, which times out with "the SSR stream never closed" without the fix.

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit 380008c
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a67a1b172c14f00087e6bff
😎 Deploy Preview https://deploy-preview-2259--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 380008c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/start@2259

commit: 380008c

@lxsmnsyc

Copy link
Copy Markdown
Member

perhaps we can move this as an upstream issue?

@birkskyum birkskyum closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants