Error: Could not resolve entry for router entry: router in PROJECT_ROOT/src
Is
src/router.tsx treated as a special file ?
In the Authenticated Routes example, there is no router.tsx, only a main.tsx
https://tanstack.com/router/latest/docs/framework/react/examples/authenticated-routes?panel=code
But when I try to use only the main.tsx file, the app breaks with a very obscure message
React TanStack Router Authenticated Routes Example | TanStack Route...
An example showing how to implement Authenticated Routes in React using TanStack Router.
2 Replies
subsequent-cyanOP•5d ago
Yeah looks like Tanstack is not using the
main.tsx file at all
So I can't inject the AuthProvider
How do I solve ?
Looks like the AuthenticatedRoutes example is outdated
I can't use Tanstack Router docs on Tanstack Start apps ?subsequent-cyanOP•5d ago
This Start docs page:
https://tanstack.com/start/latest/docs/framework/react/guide/authentication-overview#examples
Under "Client-Side Examples: -> Basic Authentication", it links to
https://github.com/TanStack/router/tree/main/examples/react/authenticated-routes
which has a
main.tsx and not a router.tsx
It should work, but the error message doesn't tell me why it doesn'tGitHub
router/examples/react/authenticated-routes at main · TanStack/router
🤖 A client-first, server-capable, fully type-safe router and full-stack framework for the web (React and more). - TanStack/router
Authentication | TanStack Start React Docs
Authentication vs Authorization Authentication: Who is this user? (Login/logout, identity verification) Authorization: What can this user do? (Permissions, roles, access control) Architecture Overview...