Skip to content

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

@jurijzahn8019

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

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