@tanstack/react-router 1.97.17 → 1.97.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.97.17",
3
+ "version": "1.97.18",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -61,13 +61,13 @@
61
61
  "@types/jsesc": "^3.0.3",
62
62
  "@vitejs/plugin-react": "^4.3.4",
63
63
  "combinate": "^1.1.11",
64
- "react": "^18.2.0",
65
- "react-dom": "^18.2.0",
64
+ "react": "^19.0.0",
65
+ "react-dom": "^19.0.0",
66
66
  "zod": "^3.24.1"
67
67
  },
68
68
  "peerDependencies": {
69
- "react": ">=18",
70
- "react-dom": ">=18"
69
+ "react": ">=18.0.0 || >=19.0.0",
70
+ "react-dom": ">=18.0.0 || >=19.0.0"
71
71
  },
72
72
  "scripts": {}
73
73
  }
package/src/router.ts CHANGED
@@ -546,7 +546,9 @@ function validateSearch(validateSearch: AnyValidator, input: unknown): unknown {
546
546
  throw new SearchParamError('Async validation not supported')
547
547
 
548
548
  if (result.issues)
549
- throw new SearchParamError(JSON.stringify(result.issues, undefined, 2))
549
+ throw new SearchParamError(JSON.stringify(result.issues, undefined, 2), {
550
+ cause: result,
551
+ })
550
552
 
551
553
  return result.value
552
554
  }
@@ -1166,9 +1168,12 @@ export class Router<
1166
1168
  undefined,
1167
1169
  ]
1168
1170
  } catch (err: any) {
1169
- const searchParamError = new SearchParamError(err.message, {
1170
- cause: err,
1171
- })
1171
+ let searchParamError = err
1172
+ if (!(err instanceof SearchParamError)) {
1173
+ searchParamError = new SearchParamError(err.message, {
1174
+ cause: err,
1175
+ })
1176
+ }
1172
1177
 
1173
1178
  if (opts?.throwOnError) {
1174
1179
  throw searchParamError