Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/tidy-donkeys-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@cloudflare/vite-plugin": patch
"miniflare": minor
---

Stop a starting `vite dev` session from crashing the runtime of another local dev session

The Vite plugin brings `workerd` up twice while starting: once to discover each Worker's exports by running it, then again with a config built from what it found. The first runtime was advertised in the dev registry before being torn down, so another dev session that resolved it was left holding a debug port that no longer existed. On Windows that could abort the other session's runtime outright, taking down a Worker that had been running happily.

Registration is now held back until the runtime that Vite settles on is the one peers will actually connect to. Reading the registry is unaffected, so a starting session still reaches Workers from sessions that are already running.

This adds two Miniflare APIs for consumers that bring their runtime up in more than one step: the `unsafeDeferDevRegistryRegistration` option, and `unsafeRegisterInDevRegistry()` to release the hold once the final runtime is ready.
9 changes: 7 additions & 2 deletions .github/workflows/test-and-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: node packages/wrangler/src/__tests__/test-old-node-version.js error

test:
timeout-minutes: 30
timeout-minutes: 60
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.suite }}-test
cancel-in-progress: ${{ github.head_ref != 'changeset-release/main' }}
Expand Down Expand Up @@ -187,7 +187,12 @@ jobs:
# Since the dev registry is now file-based (not network-based), fixture tests can safely run in parallel.
# Concurrency is capped at 2 to avoid CPU starvation on CI runners when multiple fixtures
# spawn workerd processes simultaneously (Windows runners are especially slow under load).
run: pnpm run test:ci --concurrency=2 --log-order=stream --filter="./fixtures/*" ${{ matrix.os == 'ubuntu-latest' && '--filter="!./fixtures/browser-run"' || '' }}
shell: bash
run: |
# TEMPORARY VALIDATION HARNESS — do not merge.
# Turbo runs the fixtures suite without --continue, so an unrelated
# fixture flake aborts the job before dev-registry runs. Isolate it.
pnpm run test:ci --force --log-order=stream --filter="@fixture/dev-registry"
env:
NODE_OPTIONS: "--max_old_space_size=8192"
WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/
Expand Down
Loading
Loading