sveltejs / sveltejs/kit

Changed params does not trigger load function

Open
#11,635 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

Somehow it seems that changing params in nested routes does not trigger the load function to run again.

Reproduction

https://www.sveltelab.dev/md97yhs52ldziep

When first loading you will get get an empty object for params, navigating through the (very complex, highly usefull) application doesn't update this object. Refreshing when on a lower level will run the load again and show the correct.

Bizarelly enough (but likely a good pointer for where the bug happens) going down the tree (/home -> /aa -> /aa/bb) does not work while going "up" works as expected (/aa/bb -> /aa -> /home)

Logs

No response

System Info
System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
Severity

blocking an upgrade

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 with the SvelteLab reproduction at https://www.sveltelab.dev/md97yhs52ldziep and inspect the nested-route navigation involving /home, /aa, and /aa/bb. Trace when the load function receives params during downward and upward navigation; done means changing nested route params reruns load and updates the params object without a refresh.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.