Skip to content

fix(router): don't crash Vite dev when src/entry.ssr is missing#8601

Open
maiieul wants to merge 1 commit intoQwikDev:build/v2from
maiieul:fix-router-dev-middleware-missing-entry-ssr
Open

fix(router): don't crash Vite dev when src/entry.ssr is missing#8601
maiieul wants to merge 1 commit intoQwikDev:build/v2from
maiieul:fix-router-dev-middleware-missing-entry-ssr

Conversation

@maiieul
Copy link
Copy Markdown
Member

@maiieul maiieul commented May 1, 2026

What is it?

  • Bug

Description

The dev middleware in qwik-router calls server.ssrLoadModule('src/entry.ssr') unconditionally. When the qwikRouter Vite plugin is embedded in a host that doesn't ship an entry.ssr (Storybook, component test runners, etc.), the rejected promise becomes an unhandled rejection and crashes the dev server. Wrapping the load lets those hosts fall through to next() instead.

Reproduces today on @qwik.dev/router@2.0.0-beta.34 when running Storybook over a Qwik library with qwikRouter() in the Vite config — workaround is qwikRouter({ devSsrServer: false }).

The dev middleware called ssrLoadModule('src/entry.ssr') unconditionally,
so Vite hosts that embed the qwikRouter plugin without an entry.ssr
(Storybook, component test runners, etc.) crashed the dev server with an
unhandled rejection. Wrap the load and fall through to next() instead.
@maiieul maiieul requested a review from a team as a code owner May 1, 2026 17:42
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 1, 2026

🦋 Changeset detected

Latest commit: f65af38

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

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

@maiieul maiieul self-assigned this May 1, 2026
@maiieul maiieul moved this to Waiting For Review in Qwik Development May 1, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 1, 2026

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8601

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8601

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8601

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8601

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8601

commit: f65af38

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview f65af38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting For Review

Development

Successfully merging this pull request may close these issues.

1 participant