T
TanStackโ€ข10mo ago
broad-brown

validate search params using Valibot Error

Hello, I have followed the documentation here (https://tanstack.com/router/latest/docs/framework/react/guide/search-params#valibot) for validating search params using valibot. However I got some error saying that the type doesn't match. Does anyone know how to solve this? Thanks in advance! Here's my code:
const AuthErrorSearchSchema = object({
message: optional(
fallback(string(), "An error occurred"),
"An error occurred"
),
});

export const Route = createFileRoute("/auth-error")({
validateSearch: AuthErrorSearchSchema,
});
const AuthErrorSearchSchema = object({
message: optional(
fallback(string(), "An error occurred"),
"An error occurred"
),
});

export const Route = createFileRoute("/auth-error")({
validateSearch: AuthErrorSearchSchema,
});
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user
No description
No description
5 Replies
extended-salmon
extended-salmonโ€ข10mo ago
which router and which valibot version are you using?
broad-brown
broad-brownOPโ€ข10mo ago
I'm using valibot version 1.0.0-beta.6, and tanstack router version ^1.81.2
extended-salmon
extended-salmonโ€ข10mo ago
GitHub
Release v1.81.4 ยท TanStack/router
Version 1.81.4 - 11/11/24, 11:56 PM Changes Fix react-router: update standard schema (#2729) (e13acec) by Christopher Horobin Packages @tanstack/react-router@1.81.4 @tanstack/router-valibot-adap...
extended-salmon
extended-salmonโ€ข10mo ago
since there was a breaking change in valibot
broad-brown
broad-brownOPโ€ข10mo ago
Ahh I seeee thank you so much @Manuel Schiller ๐Ÿ™๐Ÿ™

Did you find this page helpful?