router icon indicating copy to clipboard operation
router copied to clipboard

Router Status Code does not change from `404` to `200`.

Open leesb971204 opened this issue 1 year ago • 1 comments

Which project does this relate to?

Router

Describe the bug

I’m not sure if this is the intended behavior, but once the statusCode is set to 404, it doesn’t change back to 200 even when navigating to a valid route afterward.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-eekdmazt?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. Confirm that the status code is 200.
  2. Click on nowhere and check that the status code changes to 404.
  3. Then, click on about or home again.
  4. The status code does not change back to 200.

Expected behavior

When navigating to a valid route, the status code should be 200.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.127.9
  • OS: macOS
  • Browser: Chrome
  • Browser Version: [e.g. 91.1]
  • Bundler: [e.g. vite]
  • Bundler Version: [e.g. 7.0.0]

Additional context

No response

leesb971204 avatar Jul 16 '25 02:07 leesb971204

This looks like a bug to me and I've submitted a PR to fix the statusCode persistence issue.

hyungwookchoi avatar Jul 16 '25 07:07 hyungwookchoi