Skip to content

handle_event_propagation breaks due to fact that delegate is an array #17057

Closed

Description

@jurijzahn8019

Describe the bug

Hi,

the change in this commit

https://github.com/sveltejs/svelte/pull/17030/files#diff-e0947e41d13f3575875c7158bc594ec03de070b6d687220f6ca84e23336f70eaR261

Image

Breaks i a use case where

the event is added inside of a web component created with svelte >= v5.42.3
and also from another bundle which renders the webcomponent with svelte < 5.42.3 (propbably).

so something like this:

<my-element onclick={()=>console.log("hi")}>

Where "my-element" is a web-component created with svelte

In this case the call to

delegate.call()

breaks with error "delegate.call is not a function"

Image

Reproduction

Create a webcomponent with latest svelte, which also binds a "click" event to its "host" element, and bundle it.
Create a svelte app which uses the webcomponent and use onclick to bind the event on the custom-element.

Click on the element

Error arises.

Logs

System Info

Latest Chrome, Edge, Firefox, Safari

Severity

blocking an upgrade

Activity

  1. dummdidumm commented on Oct 28, 2025

    @dummdidumm
    Member

    Generally we don't support when things are compiled with multiple versions but this is exempt from that because it's compiled as a custom element.
    I guess we need to make it a) backwards compatible somehow at least for Svelte 5 b) somehow mark delegated events of web components such that they don't partake in that delegation, or don't use event delegation at all in custom element builds

  2. added theissue type on Oct 28, 2025
  3. jurijzahn8019 commented on Oct 29, 2025

    @jurijzahn8019
    Author

    We will definetely upgrade the version across all apps, but it takes time, so it would be cool, if the handling of event list could be returned for next 2-3 versions

  4. added a commit that references this issue on Feb 12, 2026
    c841580
  5. added a commit that references this issue on Feb 13, 2026
    220b526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions