sveltejs / sveltejs/kit

Stale values when navigating from within a boundary

Open
#16,207 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

router svelte 5
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

When navigating from within a boundary the route sees stale values.

Reproduction

SvelteLab

  1. Click Go
  2. You should see 1, you will see Uncaught TypeError: can't access property "y", (intermediate value).x is undefined in the console.

Switching to {#await block does work every time, await tick() does not help, flushSync does not help, setTimeout helps.

If it does not reproduce, try to refresh with the Refresh button on the main route, it's quite inconsistent in the repro but you can hit it.

Logs
Uncaught TypeError: can't access property "y", (intermediate value).x is undefined
System Info
N/A
Severity

annoyance

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked SvelteLab reproduction and follow the navigation triggered by clicking Go from within the boundary. Compare the failing behavior with the working {#await} block, noting that tick() and flushSync() do not help while setTimeout() does; done means the route consistently shows 1 without the TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.