kit icon indicating copy to clipboard operation
kit copied to clipboard

Changed params does not trigger load function

Open stephane-vanraes opened this issue 1 year ago • 4 comments

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

stephane-vanraes avatar Jan 14 '24 12:01 stephane-vanraes

Explictly listening to one of the params in the load functions, like params.level_1 fixes this. So it seems the JSON.stringify in the page and the console.log are somehow not picked up.

dummdidumm avatar Feb 19 '24 10:02 dummdidumm

https://github.com/sveltejs/kit/pull/11870 just fixed some issues with invalidation, so can you test to see if you're still having issues with 2.5.1?

benmccann avatar Feb 22 '24 17:02 benmccann

I've run into this using [email protected] and [email protected]

Even more contrived example https://www.sveltelab.dev/qly53mhr36fga7b?files=.%2Fsrc%2Froutes%2F%5Brandom%5D%2F%2Bpage.svelte

When clicking Next random string, the load function is not called nor is the page re-rendered.

Jakeii avatar Jul 12 '24 14:07 Jakeii