Skip to content

bind:this is undefined when using an action #12673

Closed
@ChristopheCorbalan

Description

@ChristopheCorbalan

Describe the bug

Hey there 👋🏻

It's been a while since I didn't give a try to Svelte 5 (last version I used was next.172) so my apologize in advance if this is an intended behavior.

When using bind:this on an HTML element and using an action on it causes the binded element to be undefined.
Removing the action does solve the issue.

Thanks!

Reproduction

Minimal REPL

Logs

No response

System Info

System:
    OS: macOS 14.4
    CPU: (12) arm64 Apple M2 Max
    Memory: 10.97 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
    bun: 1.1.13 - ~/.bun/bin/bun
  Browsers:
    Chrome: 127.0.6533.72
    Firefox Nightly: 128.0a1
    Safari: 17.4

Severity

blocking an upgrade

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions