Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hot-knives-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik-city': patch
---

FIX: return 404 for missing /build/ files.
4 changes: 4 additions & 0 deletions packages/qwik-city/src/runtime/src/route-matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ function matchRoutePart(
pathIdx: number,
pathLength: number
): PathParams | null {
if (path.startsWith('/build/')) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good place to intercept the issue without changing too much.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only for dev mode in fact it's already working fine in production.
eg. https://qwik.dev/docs/build/abc.js

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems not to take assetsDir into consideration :)

Image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, can you open a PR for that?

return null;
}

let params: PathParams | null = null;
while (routeIdx < routeLength) {
const routeCh = route.charCodeAt(routeIdx++);
Expand Down