sveltejs / sveltejs/kit

[docs] clarification on how `data` resolves keys with the same name

Open
#13,398 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

If multiple load functions return data with the same key, the last one ‘wins’
https://svelte.dev/docs/kit/load#Layout-data

Q1: What does "last one" mean? how are load functions ordered? This is confusing as another section mentions that they run in parallel.


Q2: Are load functions ordered differently during SSR vs CSR. Are the following statements correct?

  • In SSR, all load functions run in parallel
  • In CSR, all server load functions then all universal load functions
Reproduction

.

Logs

System Info
.
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 with the linked SvelteKit documentation sections for Layout data and Parallel loading. Trace the documented load-function behavior for key collisions and SSR versus CSR, then update the documentation so ordering and execution semantics answer Q1 and Q2 unambiguously.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 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.