Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

router: visible `<Link>` prefetch skips bundles for dynamic and catch-all routes

Open
#9,041 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@maiieul is already working on this.

Since Sep 29, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

Trace link-prefetch.ts from preloadRouteBundles through get-route-imports.ts, then compare it with prefetchRoute, normalizePathname, and ensureSlash. Reproduce the issue with the qwikrouter-test.prod e2e app using dynamic, catch-all, and static routes. Done means visible links preload the expected route module and component bundles without unnecessarily importing layouts and pages.

Written by the indexing model from the issue text.

Description

bug IMPORTANT router V2

What is it?

  • Bug

Description

A visible <Link> (prefetchBundles="visible", the default) preloads nothing for dynamic routes. link-prefetch.ts calls preloadRouteBundles(url.pathname), so the preloader gets products/123/, but the bundle graph keys routes by name (products/[id]/, see get-route-imports.ts). Static routes work because their pathname is their route name. Link clicks and SPA navigation go through prefetchRoute(), which resolves the route name first. 48fb84ed0 had moved the visible path to prefetchRoute() too, but the merge with the shared-observer refactor (4ba1ad594) only carried over the data branch.

Catch-all routes miss even through prefetchRoute(). The build keys docs/[...slug]/index.tsx as docs/[...slug] with no trailing slash, because normalizePathname treats a last segment containing . as a file name. prefetchRoute() calls ensureSlash and looks up docs/[...slug]/, so Link clicks and SPA navigation miss catch-all bundles too. Other routes whose last segment contains a dot, and maybe every route with trailingSlash: false, likely hit the same mismatch (not checked).

Reproduced on a production build of the qwikrouter-test.prod e2e app with temporary [id], [...slug] and static routes: only the static link's bundles loaded. #9040 (closed, untested) switched the observer to prefetchRoute(). With it, [id] links loaded their route module and component bundle, but [...slug] links only got their route module. prefetchRoute() also runs loadRoute(), which imports each visible link's layout and page modules instead of only queuing preload hints, so pages with many links would do more work.

Dominant language
TypeScript
Stars
22.1k
Forks
1.4k
Avg merge
1d 17h
Merged PRs (30d)
98

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from QwikDev/qwik

All issues in QwikDev/qwik

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.