@tanstack/router-core 1.167.2 → 1.167.3

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.167.2",
3
+ "version": "1.167.3",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -391,9 +391,10 @@ const executeBeforeLoad = (
391
391
  const match = inner.router.getMatch(matchId)!
392
392
 
393
393
  // explicitly capture the previous loadPromise
394
- const prevLoadPromise = match._nonReactive.loadPromise
394
+ let prevLoadPromise = match._nonReactive.loadPromise
395
395
  match._nonReactive.loadPromise = createControlledPromise<void>(() => {
396
396
  prevLoadPromise?.resolve()
397
+ prevLoadPromise = undefined
397
398
  })
398
399
 
399
400
  const { paramsError, searchError } = match
@@ -835,6 +836,7 @@ const loadRouteMatch = async (
835
836
  match._nonReactive.loaderPromise?.resolve()
836
837
  match._nonReactive.loadPromise?.resolve()
837
838
  match._nonReactive.loaderPromise = undefined
839
+ match._nonReactive.loadPromise = undefined
838
840
  } catch (err) {
839
841
  if (isRedirect(err)) {
840
842
  await inner.router.navigate(err.options)
@@ -926,6 +928,7 @@ const loadRouteMatch = async (
926
928
  if (!loaderIsRunningAsync) {
927
929
  match._nonReactive.loaderPromise?.resolve()
928
930
  match._nonReactive.loadPromise?.resolve()
931
+ match._nonReactive.loadPromise = undefined
929
932
  }
930
933
 
931
934
  clearTimeout(match._nonReactive.pendingTimeout)
package/src/router.ts CHANGED
@@ -2120,9 +2120,10 @@ export class RouterCore<
2120
2120
  const isSameUrl =
2121
2121
  trimPathRight(this.latestLocation.href) === trimPathRight(next.href)
2122
2122
 
2123
- const previousCommitPromise = this.commitLocationPromise
2123
+ let previousCommitPromise = this.commitLocationPromise
2124
2124
  this.commitLocationPromise = createControlledPromise<void>(() => {
2125
2125
  previousCommitPromise?.resolve()
2126
+ previousCommitPromise = undefined
2126
2127
  })
2127
2128
 
2128
2129
  // Don't commit to history if nothing changed