@tanstack/router-core 1.121.12 → 1.121.15

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.121.12",
3
+ "version": "1.121.15",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/router.ts CHANGED
@@ -2055,6 +2055,9 @@ export class RouterCore<
2055
2055
  }
2056
2056
  }
2057
2057
 
2058
+ match.beforeLoadPromise?.resolve()
2059
+ match.loaderPromise?.resolve()
2060
+
2058
2061
  updateMatch(match.id, (prev) => ({
2059
2062
  ...prev,
2060
2063
  status: isRedirect(err)
@@ -2072,8 +2075,6 @@ export class RouterCore<
2072
2075
  ;(err as any).routeId = match.routeId
2073
2076
  }
2074
2077
 
2075
- match.beforeLoadPromise?.resolve()
2076
- match.loaderPromise?.resolve()
2077
2078
  match.loadPromise?.resolve()
2078
2079
 
2079
2080
  if (isRedirect(err)) {
@@ -2180,9 +2181,12 @@ export class RouterCore<
2180
2181
  }, pendingMs)
2181
2182
  }
2182
2183
 
2184
+ console.log(`Match ${matchId} is already loading`, {
2185
+ match: this.getMatch(matchId),
2186
+ })
2183
2187
  // Wait for the beforeLoad to resolve before we continue
2184
2188
  await existingMatch.beforeLoadPromise
2185
- executeBeforeLoad = this.getMatch(matchId)!.status !== 'success'
2189
+ executeBeforeLoad = this.getMatch(matchId)!.status === 'error'
2186
2190
  }
2187
2191
  if (executeBeforeLoad) {
2188
2192
  // If we are not in the middle of a load OR the previous load failed, start it