Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Svelte 5 HMR Bug Report | GoodFirstPicks

Svelte 5 HMR Bug Report

sveltejs/svelte 2 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeSvelteTypeScript

Why this is a good first issue

HMR-related hydration bug with clear reproduction but requires Svelte internals knowledge.

AI Summary

The issue describes a HMR-related hydration bug during soft reloads in development mode, with a clear reproduction path. Fixing it would require understanding Svelte's HMR and hydration internals, but the problem is isolated to development mode only. The main blocker is needing deep knowledge of Svelte's runtime operations.

Issue Description

Describe the bug

When running SvelteKit in development mode, performing a soft reload (Ctrl+R or clicking refresh) causes the following error:

TypeError: can't access property "call", first_child_getter is undefined
    get_first_child operations.js:89
    from_html template.js:71
    add_locations elements.js:15
    Root root.svelte:68
    effect2 hmr.js:50
    update_reaction runtime.js:260
    update_effect runtime.js:439
    create_effect effects.js:124
    branch effects.js:419
    wrapper hmr.js:41
    update_reaction runtime.js:260
    update_effect runtime.js:439
    create_effect effects.js:124
    block effects.js:396
    wrapper hmr.js:30
    unmount2 render.js:228
    ...

Hard reload (Ctrl+Shift+R) works fine. The error only occurs on soft reload.

Additionally, after this error occurs, the page becomes completely unresponsive - no interactions (clicks, inputs, etc.) work until a hard reload is performed.

Reproduction

  1. Create a new SvelteKit project with Svelte 5
  2. Run npm run dev
  3. Open the app in browser
  4. Press Ctrl+R (soft reload) or click the refresh button
  5. Error appears in console
  6. Try to interact with the page - nothing works

Expected behavior

Soft reload should work without errors, same as hard reload. The page should remain interactive after reload.

Environment

  • Svelte: 5.45.6
  • SvelteKit: 2.49.1
  • Vite: 7.2.6
  • Browser: Firefox (also happens in Chrome)
  • OS: macOS

Workaround

Setting hmr: false in vite.config.ts prevents the error but disables HMR entirely:

// vite.config.ts
export default defineConfig({
  server: {
    hmr: false
  }
});

Additional context

  • The error originates from operations.js:89 in Svelte's internal DOM operations
  • Stack trace shows it's related to hydration during HMR
  • Production build works fine - tested with npm run build && npm run preview, no errors on soft reload
  • This is strictly a development mode issue
  • Related issues:
    • https:

GitHub Labels

awaiting submitter

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • HMR internals
  • hydration logic
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno