Skip to content

Crash node is null when using extension like ProtonPass #14920

@matubu

Description

@matubu

Describe the bug

Extension like ProtonPass sometimes add controls in the DOM when you focus inputs

proton controls

If ProtonPass insert an element before the page is fully loaded / before hydration took over. Svelte 5 crash

proton-svelte-crash.webm

Is their a way to prevent this crash ?

Related: #14761

Reproduction

  1. Install ProtonPass
  2. Create a Svelte +page.svelte, with the following code:
<form>
	<input type="email" name="email" />
	{#if false}Hello World{/if}
</form>
  1. Refresh/Load the page
  2. Focus the input before the page is fully loaded (the slower the load time, the more likely is it to be at the right timing)

Logs

Uncaught (in promise) TypeError: node is null              hydration.js:90:6

  in +page.svelte
  in layout.svelte
  in root.svelte
    remove_nodes hydration.js:90
    update_branch if.js:60
    if_block if.js:104
    update_reaction runtime.js:401
    update_effect runtime.js:527
    create_effect effects.js:125
    block effects.js:362
    if_block if.js:100
    _page +page.svelte:26
    effect2 hmr.js:47

System Info

System:
    Container: Yes
  Binaries:
    Node: 22.12.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.9.0 - /usr/local/bin/npm
  Browsers:
    Firefox: 133.0.3
    ProtonPass: 1.26.0
  npmPackages:
    svelte: 5.16.4 => 5.16.4

Severity

blocking all usage of svelte

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions