Skip to content

Commit 721b532

Browse files
authored
fix: discard preload fork before creating a new one (#14865)
* fix: discard preload fork before creating a new one * tidy up
1 parent bb16a8f commit 721b532

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/shy-clocks-smoke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: discard preload fork before creating a new one

packages/kit/src/runtime/client/client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,8 @@ async function _preload_data(intent) {
514514
// then a later one is becoming the real navigation and the preload tokens
515515
// get out of sync.
516516
if (intent.id !== load_cache?.id) {
517+
discard_load_cache();
518+
517519
const preload = {};
518520
preload_tokens.add(preload);
519521
load_cache = {

0 commit comments

Comments
 (0)