Skip to content

Trace the eager-fetch-during-SSR warning on /admin/settings #393

Description

@linear-code

SvelteKit logs "Avoid calling fetch eagerly during server-side rendering" eleven times when /admin/settings renders under the dev server. Nobody owns it and nothing on the page visibly misbehaves, but it is a real warning about a real pattern and it fires on every render of that route.

Why this is worth a look rather than ignoring

The warning means a fetch is being started during SSR without being awaited in a way SvelteKit can track, so its result cannot be serialised into the hydration payload. The client then repeats the request after hydration. On a page that already performs several D1 reads plus an UploadThing usage call plus an R2 listing, a duplicated request is worth understanding even if the current cost is small.

What is established

  • Observed, not inferred. It was first reported as pre-existing based on reasoning. That was then checked properly: the settings-tabs and supporter-key e2e specs were run against a dev server with the Live at a convention: here-now state on /connect + QR handoff and con card #219 branch's new spec absent, and the warning still fired eleven times. So it predates that work and is not caused by it.
  • Eleven occurrences per render suggests a loop or a repeated component rather than one stray call.
  • Only seen against the dev server so far. Whether it also fires in a production build is unverified.

Suggested first step

Render /admin/settings under npx vite dev with a stack trace on the warning to identify which module issues the call, then decide whether it wants event.fetch, an await, or moving out of the render path entirely. Confirm whether it reproduces against vite build + vite preview before deciding it matters.

Found during the #219 ship loop. Not caused by that change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

adminAdmin panel / CMSopsCI, deployment, infra, botspriority: lowNice to have

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions