T
TanStack3mo ago
exotic-emerald

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"
"@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;
});
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({ ... });
export const ServerRoute = createServerFileRoute("/api/auth/google/").methods({ ... });
route with:
/api/auth/google?redirect=abc&def=123
/api/auth/google?redirect=abc&def=123
as a URL.
13 Replies
exotic-emerald
exotic-emeraldOP3mo ago
The code hasn't changed and with vinxi everything worked correctly,
genetic-orange
genetic-orange3mo ago
is this when running the dev server or when running the prod build?+
exotic-emerald
exotic-emeraldOP3mo ago
@Manuel Schiller Dev server
genetic-orange
genetic-orange3mo ago
a reproducer would be helpful.
exotic-emerald
exotic-emeraldOP3mo ago
@Manuel Schiller I'll work on that. Anything in your experience that could cause this?
genetic-orange
genetic-orange3mo ago
not directly. seems like the query is lost somehow along the chain
exotic-emerald
exotic-emeraldOP3mo ago
@Manuel Schiller is there a quick repo I can clone and add on top of by any chance?
genetic-orange
genetic-orange3mo ago
Quick Start | TanStack Start React Docs
Impatient? If you're impatient, you can clone and run the example right away with the following commands: bash npx gitpick TanStack/router/tree/main/examples/react/start-basic start-basic cd start-bas...
exotic-emerald
exotic-emeraldOP3mo ago
Awesome thanks ❤️
exotic-emerald
exotic-emeraldOP3mo ago
@Manuel Schiller Opened a bug report here: https://github.com/TanStack/router/issues/4536
GitHub
getValidatedQuery always returns {} · Issue #4536 · TanStack/...
Which project does this relate to? Router Describe the bug The new getValidatedQuery from TSS keeps returning no query params (and/or works differently from how the equivalent function worked with ...
exotic-emerald
exotic-emeraldOP3mo ago
🤞
rising-crimson
rising-crimson2mo ago
would be awesome if we can know if this is being fixed or not, currently we planning to move to the newer version, but h3 utils not working in api routes, is stopping us from doing that
genetic-orange
genetic-orange2mo ago
GitHub
Release v1.125.6 · TanStack/router
Version 1.125.6 - 7/7/25, 6:14 PM Changes Fix correct url in dev server (#4593) (ba6f0ba) by Manuel Schiller set component return type to any by default (#4592) (7ff52af) by Manuel Schiller Docs ...

Did you find this page helpful?