@tanstack/router-core 1.136.13 → 1.136.14

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/router-core",
3
- "version": "1.136.13",
3
+ "version": "1.136.14",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/router.ts CHANGED
@@ -1388,7 +1388,7 @@ export class RouterCore<
1388
1388
 
1389
1389
  const strictParams = existingMatch?._strictParams ?? usedParams
1390
1390
 
1391
- let paramsError: PathParamError | undefined = undefined
1391
+ let paramsError: unknown = undefined
1392
1392
 
1393
1393
  if (!existingMatch) {
1394
1394
  const strictParseParams =
@@ -1401,9 +1401,13 @@ export class RouterCore<
1401
1401
  strictParseParams(strictParams as Record<string, string>),
1402
1402
  )
1403
1403
  } catch (err: any) {
1404
- paramsError = new PathParamError(err.message, {
1405
- cause: err,
1406
- })
1404
+ if (isNotFound(err) || isRedirect(err)) {
1405
+ paramsError = err
1406
+ } else {
1407
+ paramsError = new PathParamError(err.message, {
1408
+ cause: err,
1409
+ })
1410
+ }
1407
1411
 
1408
1412
  if (opts?.throwOnError) {
1409
1413
  throw paramsError