Skip to content

Warning with TanStack Start template: "useRouter must be used inside a <RouterProvider> component" #204

@TrevorBurnham

Description

@TrevorBurnham

Steps to replicate:

  1. Create a new project with npm create convex@latest and select TanStack Start and WorkOS
  2. Run npm install and npm run dev
  3. Open http://localhost:3000 in your browser

You'll see this warning in both your shell and the browser console on every pageload:

Warning: useRouter must be used inside a <RouterProvider> component!

In the browser, the warning is a stack trace, which shows that the warning is being emitted from AuthKitProvider. The AuthKitProvider is defined alongside the router, but no RouterProvider is being used. AFAICT this doesn't impact functionality, it just creates noise.

Related: TanStack/router#2978

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions