Skip to content

fix: prevent fetch wrapper chains across dev server reloads - #17543

Draft
svelte-triage-bot[bot] wants to merge 1 commit into
mainfrom
triage/kit-17542-dev-fetch-reload
Draft

svelte-triage-bot[bot] wants to merge 1 commit into
mainfrom
triage/kit-17542-dev-fetch-reload

Conversation

@svelte-triage-bot

Copy link
Copy Markdown
Contributor
  • SSR program reloads captured the previous global fetch wrapper, retaining each old runtime module graph.
  • Preserve the decoded-response warning from #16633 and configured-runtime boundary from #17008; reuse the symbol-keyed dev state introduced in #16663 for the pre-runtime fetch.
  • Recreate the wrapper using that fetch and the current response map rather than installing it once, which would retain stale runtime state and lose warnings after reloads.
  • Cover repeated evaluation, existing fetch forwarding and decoded-response diagnostics with deterministic unit tests instead of racing file-watcher events. Production and temporary rendering wrappers remain unchanged.

Fixes #17542

@pkg-svelte-dev

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 5f13126:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/5f131260ea78f36f6860f5ac11949c9673410837

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/17543

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5f13126

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev server: globalThis.fetch is wrapped again on every server reload, leaking each reload's modules

0 participants