Skip to content

Throwing notFound() in beforeLoad() already shows the error during preload #1796

@melv-n

Description

@melv-n

Describe the bug

I don't even need to click the link, as soon as I hover over it, I get the "Not found" error message?

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-xxntjv?file=src%2Froutes%2Fbrowse.%24.tsx

Steps to Reproduce the Bug or Issue

  1. Go to /browse
  2. Hover over "Browse 404"

Expected behavior

No error, just a preloading in the background. Only when I click the link will I see the not found error.

Actual behavior

The 404 error is shown as soon as I hover over the link as a result of preloading that page.

Platform

  • OS: macOS + Arc 1.47

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions