Skip to content

fix: dispose adapter emulators after use - #17192

Closed
svelte-triage-bot[bot] wants to merge 13 commits into
version-3from
triage/kit-17191-dispose-emulator
Closed

svelte-triage-bot[bot] wants to merge 13 commits into
version-3from
triage/kit-17191-dispose-emulator

Conversation

@svelte-triage-bot

Copy link
Copy Markdown
Contributor
  • Kit created emulators for prerender, dev, and preview without a teardown contract, leaving Cloudflare's Wrangler proxy and its workerd child alive after builds.
  • Preserve the lazy, single-proxy behavior introduced by #12830 and #13373, while adding idempotent disposal once each lifecycle ends.
  • Add an optional Emulator.dispose hook and await it after drained prerender work and Vite server shutdown; adapter-only process-exit cleanup was rejected because it would miss dev, preview, and third-party emulators.
  • Cover successful and failed shutdown, concurrent proxy acquisition/disposal, and prerender queue failures so no in-flight request can outlive its emulator.

Fixes #17191

teemingc and others added 13 commits August 6, 2026 12:10
Don't think these will run for us on the `version-3` branch unless
they're also on the `main` branch

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @sveltejs/kit@2.70.3

### Patch Changes

- fix: avoid eagerly reading `$app/state` dependencies during module
initialization

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Elliott Johnson <hello@ell.iott.dev>
Co-authored-by: Conduitry <git@chor.date>
Applies the GitHub Actions changes from sveltejs#17045 to ensure split edge
functions are deployed and exercised by Netlify platform tests.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Nic Polumeyv <nicolas.polum@outlook.com>
Co-authored-by: Nic Polumeyv <162764842+Nic-Polumeyv@users.noreply.github.com>
this shouldn't have the lightbulb icon
Same as sveltejs#17122 but based onto `main` because our bot only runs the
workflows on that branch. Also includes the applicable corrections from
sveltejs#17152.

Netlify and Vercel use isolated build, deploy, and test jobs with
provider secrets confined to deployment. Node keeps a separate local
Playwright test action, while deployment tests use the renamed
deployment-specific action. Netlify now builds its adapter before the
test app. The Bun and Netlify instrumentation jobs removed from `main`
are intentionally not restored.

---

### Please don't delete this checklist! Before submitting the PR, please
make sure you do the following:
- [x] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it
solves.
- [ ] Ideally, include a test that fails without this PR but passes with
it.

### Tests
- [ ] Run the tests with `pnpm test` and lint the project with `pnpm
lint` and `pnpm check`

Validated changed YAML with oxfmt 0.68.0, actionlint 1.7.12, YAML
parsing, and `git diff --check`. The restored Node platform flow passes
all 4 Playwright tests, and a fresh Netlify adapter plus test-app build
succeeds.

### Changesets
- [x] If your PR makes a change that should be noted in one or more
packages' changelogs, generate a changeset by running `pnpm changeset`
and following the prompts. Changesets that add features should be
`minor` and those that fix bugs should be `patch`. Please prefix
changeset messages with `feat:`, `fix:`, or `chore:`.

No changeset is needed for CI workflow-only changes.

### Edits

- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs
without this option may be closed.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Three fixes:
- specify a pnpm version when setting it up in the deploy step. Need
this because there's no package.json in the deploy step which would have
specified it.
- ignore a missing build script in the Netlify package. The `version-3`
branch does not have it but `main` does.
- improve the platform job names

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
same as sveltejs#17155 but on `main` so I
can get back to the Railway folks that it's on our site already
@pkg-svelte-dev

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 74aeae8:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/74aeae8e194da5a93787471b309ba1cf3b37cb8f

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

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 Sep 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 74aeae8

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

This PR includes changesets to release 2 packages
Name Type
@sveltejs/kit Patch
@sveltejs/adapter-cloudflare 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

@teemingc

Copy link
Copy Markdown
Member

@svelte-triage-bot you are not supposed to open PRs for closed issues. Record this as feedback for yourself

@teemingc teemingc closed this Sep 23, 2026
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.

bug: adapter-cloudflare leaks a workerd on every build on the stable line (7.2.9, npm latest)

4 participants