Steve AS
Denoβ€’5mo agoβ€’
5 replies
Steve A

Type checking with tanstack router

I've been developing a project with tanstack router, deno, and hono. It's working fine; my IDE is happy, the app runs, and I can run
deno lint
and deno format without issues. However, when I run
deno check
, I always get errors like this:

TS2345 [ERROR]: Argument of type '"/visualize"' is not assignable to parameter of type 'undefined'.
export const Route = createFileRoute("/visualize")({
                                     ~~~~~~~~~~~~
    at file:///Users/steve.adams/Work/DarwinKit/src/routes/visualize.tsx:28:38

I'm hoping someone might be able to clue me in to why deno's type checker wouldn't be aware of the tanstack router types. The tanstack router model is declared in the generated route tree, along with in my app's entry point:

import { routeTree } from "./routeTree.gen.ts";

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      staleTime: 1000 * 60 * 5,
      retry: 1,
    },
  },
});

const router = createRouter({
  routeTree,
  context: { queryClient },
  defaultPreload: "intent",
});

declare module "@tanstack/react-router" {
  interface Register {
    router: typeof router;
  }
}


Thanks for any insight here! I'm really stumped.
Was this page helpful?