-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Which project does this relate to?
Start
Describe the bug
I was writing the e2e tests for my application and I noticed that in production the Not found test worked fine but when using the dev command to run the tests it was breaking on the test.
✅ But in production the component is rendering normally as it is supossed to be:

❌
- I was using Bun, but with a brand new Node, the issue still happens.
- The error just happens in vite dev.
✅
- After building the project and running with node ./output/server/index.mjs it works fine.
- I also noticed that commenting out the nitro plugin on vite.config.ts then running vite dev the not found component starts working again.
Your Example Website or App
https://github.com/gabenddos/tanstack-start-not-found-dev-error
Steps to Reproduce the Bug or Issue
- Scaffolding a brand new Tanstack Start project
- Setup the notFoundComponent (on router or any specific route you want) e.g.
src/router.tsx
const router = createRouter({
routeTree,
context: {
...rqContext,
},
defaultNotFoundComponent: () => <div>Not Found</div>, // ADDED NOT FOUND COMPONENT
defaultPreload: "intent",
});- Runs the dev server with
pnpm devorbun dev. - Access any non existing route: e.g. http://localhost:3000/non-exising-route or /lorem-ipsum, etc...
"Cannot Get /{pathname}" instead of the actual react not found component
Expected behavior
Should render react not found component instead of a Cannot Get error page.
Screenshots or Videos
No response
Platform
- Router / Start Version: ^1.132
- OS: macOS
- Browser: Chrome
- Browser Version: 143 (latest stable)
- Bundler: Vite
- Bundler Version: 7.1.7
Additional context
Stack blitz does not seams to reproduce the error, please clone the repo and run locally.
Related issue: #5960 Throwing a notFound on loaders seams to have the same bahaviour described in this issue
zotodev
Metadata
Metadata
Assignees
Labels
No labels
