Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefetching a link still results in a second blocking loader request #13255

Open
ddehueck opened this issue Mar 18, 2025 · 0 comments
Open

Prefetching a link still results in a second blocking loader request #13255

ddehueck opened this issue Mar 18, 2025 · 0 comments
Labels

Comments

@ddehueck
Copy link

ddehueck commented Mar 18, 2025

I'm using React Router as a...

framework

Reproduction

Stackblitz example: https://stackblitz.com/edit/github-bcauexzv?file=app%2Froutes%2Fhome.tsx

System Info

System:
    OS: macOS 14.3.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 871.56 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.0 - ~/.nvm/versions/node/v20.19.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.19.0/bin/npm
    pnpm: 10.6.4 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 134.0.6998.89
    Edge: 134.0.3124.68
    Safari: 17.3.1
  npmPackages:
    @react-router/dev: ^7.3.0 => 7.3.0 
    @react-router/fs-routes: ^7.3.0 => 7.3.0 
    @react-router/node: ^7.3.0 => 7.3.0 
    @react-router/serve: ^7.3.0 => 7.3.0 
    react-router: ^7.3.0 => 7.3.0 
    vite: ^5.4.11 => 5.4.14

Used Package Manager

npm

Expected Behavior

I would expect no secondary loader request and an instant navigation as loader has already been called via the render prefetch.

As shown in: https://youtu.be/ZGxVXcYC6bU?t=190

Actual Behavior

  1. On render a request to test.data is sent and resolved
  2. On click of prefetched link another test.data request is sent and blocks navigation until resolved
Image
@ddehueck ddehueck added the bug label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant