Skip to content

watchEffect performs bad with emits #13338

Open
@FanetheDivine

Description

@FanetheDivine

Vue version

3.5.13

Link to minimal reproduction

https://codesandbox.io/p/devbox/vue-test-54xk9s

Steps to reproduce

run the project and open devtool

What is expected?

The number on page is 1. 1 second later it turns to 2 and doesn't change.
An "setup" and an "effect" are printed

What is actually happening?

The number on page is 1. 1 second later it turns to 3, and every 1 second later it grows 2
An "setup" and an "effect", and every 1 second later an "effect" is printed

System Info

Any additional comments?

it seems like emits were collected as watchEffect's dependence

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.has workaroundA workaround has been found to avoid the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions