Skip to content

Fix HMR breaking after vite server restarts - #1732

Merged
AlecAivazis merged 1 commit into
mainfrom
duplicate-compiler-lock
Jul 15, 2026
Merged

Fix HMR breaking after vite server restarts#1732
AlecAivazis merged 1 commit into
mainfrom
duplicate-compiler-lock

Conversation

@AlecAivazis

Copy link
Copy Markdown
Collaborator

When vite restarts the dev server (config change, lockfile change, pressing r), HMR would break until the dev server was manually restarted, failing on every save with:

[houdini] HMR pipeline error: Error: database is not open

Vite creates the replacement server before closing the old one, and two things went wrong in that window:

  1. Compiler ownership: the dev compiler lived in a module-level export let compiler in vite/hmr.ts. By the time the old server's close handler ran, that binding pointed at the replacement's compiler, so the old server shut down the new server's compiler and database connection.

  2. Session overlap: the new session wiped and recreated the orchestration database while the old session's plugin processes were still running. Plugin registration collided with leftover rows (UNIQUE constraint failed: plugins.name), and since the Go side treated that as fatal, the fresh plugin died and the orchestrator was left dialing a port nobody listens on (ECONNREFUSED).

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1506beb

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

This PR includes changesets to release 3 packages
Name Type
houdini Patch
houdini-core Patch
houdini-svelte 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

@AlecAivazis
AlecAivazis merged commit ead2012 into main Jul 15, 2026
15 checks passed
@AlecAivazis
AlecAivazis deleted the duplicate-compiler-lock branch July 15, 2026 14:26
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.

1 participant