Putting auth context in RouterProvider context gives errors
I'm wanting to put the authClient of better-auth into the context of RouterProvider.
I get the error found in the first image.
From the better-auth dev:
Unfortunately, my current stack is complex:
- Electron
- Vite
- Tanstack Router
- Hono.js
- Pglite DB server
- Drizzle (Electron+Hono.js)
- Better-auth
So I have reduced it now to:
- Tanstack Router
- Hono.js
- Turso
- Better-auth
Here is the repo:
https://github.com/paulm17/router-hono
- pnpm i
- pnpm run dev (both hono and router will start)
- navigate to http://localhost:5173
- open up dev tools for the redirected login page and you'll see the second image
@Manuel Schiller
I get the error found in the first image.
From the better-auth dev:
I think It's cause tanstack tries to call toJSON on the objects you pass to the context.
Unfortunately, my current stack is complex:
- Electron
- Vite
- Tanstack Router
- Hono.js
- Pglite DB server
- Drizzle (Electron+Hono.js)
- Better-auth
So I have reduced it now to:
- Tanstack Router
- Hono.js
- Turso
- Better-auth
Here is the repo:
https://github.com/paulm17/router-hono
- pnpm i
- pnpm run dev (both hono and router will start)
- navigate to http://localhost:5173
- open up dev tools for the redirected login page and you'll see the second image
@Manuel Schiller
