Skip to content

BToggle directive producing console error when unmounted quickly #2856

@IGx89

Description

@IGx89

Describe the bug

While updating to BSV v0.40 I've noticed the following console error popping up occasionally in my logs, both during unit tests and in the browser:

Could not find original vnode, will not inherit provides

It's being thrown from the call to findProvides from the handleUnmount method of the BToggle directive. It appears that findProvides throws that error if the element passed in has been removed from the DOM. This error can be reproduced by adding a v-if to the element that the directive is on and then changing it to false after it initially being true, forcing an unmount.

The logic inside findProvides is a bit too complex for me to attempt a PR myself, though I did notice that the project that that code was borrowed from (vuetify) is not using it in an unmount handler, just in mount.

Reproduction

https://stackblitz.com/edit/github-tkn26tgr?file=src%2Fcomponents%2FComp.vue

Used Package Manager

npm

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleThere has been no additional replies or questions and the thread is assumed closed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions