Skip to content

fix: deleting an island wedges the dev server#3883

Open
aiibe wants to merge 2 commits into
freshframework:mainfrom
aiibe:fix/island-delete-wedges-dev-server
Open

fix: deleting an island wedges the dev server#3883
aiibe wants to merge 2 commits into
freshframework:mainfrom
aiibe:fix/island-delete-wedges-dev-server

Conversation

@aiibe

@aiibe aiibe commented Jun 26, 2026

Copy link
Copy Markdown

The problem

Delete any file from islands/ while running deno task dev and the app crashes on reload page with a permanent 500 until you restart. Fresh auto discovers that folder so it happens even when the island isn't used anywhere.

Second bug: delete one island while another is still on the page and the surviving island quietly stops reacting after the next reload.

Steps to reproduce

  1. Run deno task dev and open /about. It renders the Foo and Bar islands.
  2. In about.tsx remove <Bar /> and its import so the page keeps only Foo.
  3. Delete islands/Bar.tsx.
  4. Before the fix the page 500s, or reloads with Foo rendered but dead so it no longer reacts to clicks.

What was happening

The watcher only looked at routes/ so deleting an island never triggered a rebuild. The snapshot map only ever added islands and never dropped deleted ones, leaving a stale static import that choked the server. And on a cold client graph right after a delete, a surviving island's boot import got recorded as the internal fresh-island::Name specifier, so the browser got a bare import it couldn't resolve and the island never hydrated.

The fix

The watcher now tracks islands too. The load handler rebuilds the island map from scratch on every reload instead of appending, with a small cache so names stay stable. And it skips the fresh-island::Name specifier when recording a chunk, keeping the real /@id/... URL so a survivor always boots.

Testing

One regression test loads a page with a live island, deletes a sibling, then checks the server stays at 200 and the survivor still hydrates and stays clickable with no fresh-island:: in the HTML.

@aiibe

aiibe commented Jun 30, 2026

Copy link
Copy Markdown
Author

Pushed a follow up. Fixing the wedge exposed a related client side bug where a surviving sibling island stopped hydrating. Added a guard and updated the description.

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