Warning: A notFoundError was encountered on the route with ID "__root__"
I have an extremely simple Start application. My
/app/routes/__root.tsx
looks like this:
In the outlet, I am rendering this component from /app/routes/index.tsx
For some reason, I am encountering a notFoundError in __root.tsx
, and I don't understand why
For reference, here are my other necessary files:
5 Replies
mute-gold•10mo ago
not sure what's causing a 404 in your case (usually i think its from a nonexistent favicon) but you can add a defaultNotFoundComponent when creating your router like here:
https://github.com/TanStack/router/blob/main/examples/react/start-basic/app/router.tsx#L11
edit: yeah most browsers will automatically try to GET
/favicon.ico
even if not defined in head, triggering a 404 if it doesnt existgraceful-blueOP•10mo ago
I'm gonna try the favicon fix tomorrow, thanks for the suggestion 😎 If it doesn't fix it, I'm gonna create a barebones repro project in stackblitz. I just felt that I wanted to get to the bottom of the notFoundError warning, even if adding a defaultNotFoundComponent does silence the warning
flat-fuchsia•10mo ago
sounds like this https://github.com/TanStack/router/issues/2459
GitHub
notFoundError warning triggers when rendering root route · Issue #2...
Which project does this relate to? Start Describe the bug Warning about notFoundError is shown when rendering root route and there's no defaultNotFoundComponent set, even though it renders succ...
flat-fuchsia•10mo ago
can you please comment on that when you find out anything?
mute-gold•10mo ago