TanStackT
TanStack7mo ago
13 replies
good-rose

h3 `getValidatedQuery` not working after devinxi?

I'm about to create a repro when I have some time but I was wondering: is getValidatedQuery (to parse query params), which is now apparently from h3 supposed to work the same as vinxi's one?

I'm on:
"@tanstack/react-router": "1.121.34",
"@tanstack/react-router-with-query": "1.121.34",
"@tanstack/react-start": "1.121.34"


and running:
import {
  getValidatedQuery,
  readValidatedBody,
} from "@tanstack/react-start/server";

  await getValidatedQuery((query) => {
    console.log(query);
    return true;
  });


gives me an empty object ([Object: null prototype] {} to be precise) inside a:

export const ServerRoute = createServerFileRoute("/api/auth/google/").methods({ ... });


route with:
/api/auth/google?redirect=abc&def=123

as a URL.
Was this page helpful?