Repository navigation
fix(router): serve static files under the configured base path - #9010
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: ecd66ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
@qwik.dev/core
@qwik.dev/router
@qwik.dev/utils
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
@qwik.dev/devtools
commit: |
maiieul
approved these changes
Sep 18, 2026
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What is it?
Description
Fixes #8812.
With a base such as
/docs/, a request for/docs/hello.txtcan be recognized as static but is read fromdist/docs/hello.txt, while the file is actually atdist/hello.txt. Build and asset directory prefixes also omit the base.Use the configured base for build/asset classification, then strip it at the filesystem boundary in the Node, Deno, and Bun middleware. Preserve full URL paths in the prerendered-path lookup and keep the existing trailing-slash behavior. Deno and Bun derive the filename from the stripped pathname too.
Filesystem access still follows static-path eligibility checks, and the base must match at a slash boundary. Encoded path segments remain encoded.
The focused suite covers public files, nested bases, root/index pages, both trailing-slash modes, build/assets without manifest entries, and paths outside the base. All 50 tests pass; restoring the original production implementations produces 23 failures.
Validation:
pnpm build.coreand the Router TypeScript check pass.should make Node response progress before render completes; this environment does not permit its localhost listener.Checklist