Skip to content

Infinite Loop when trigger ref getter then setter in AppConfig.errorHandler #9574

Closed
@bsuth

Description

@bsuth

Vue version

Commit 2c0414f (Latest at time of writing)

Link to minimal reproduction

https://play.vuejs.org/#eNp9UsFOIzEM/RUrF1qpSg/cWEDarZCWlRYQcMyBdMbtDGSSKHHKVKP5d5wMFBAIKYfE7/n52c4gfnsvdwnFiTiNVWg9QURK/lzZtvMuEAywRVqlENDSpY2kbYULCLiBETbBdXDE6Ue/lFW2coxDD2cZnv3X1Migbe262XxeCF+VZnOpvV85S9iTZIFNu5UYggt/OdNgYLHZHM7OYVAWoJc7bRKy2OHOhE+VGBtLseUS7ps2Ah9nzR5SxBrIQaX5BtpCKQN1Cq3dsmNbY74tSuZz01YN4I6tJm04e53Wa4MxCzx8Y/NBvrW/Z0M2GcMeTpfTSHmY/CDsvNGE/AIYBtjLNYxjZh0QsRAUX9Ufo7O8ldK2EpXrfMt1rj21XEaJk2kgGWN/7vlfiVFIyA1M8arB6umb+GPsc0yJm4ARww6VOGCkAy9pgi/urngpH8DO1ckw+wfwFqMzKXucaH9SGc8HXnF7Wf4WT/s+XvSENr41lY1m5lj4SvDfWv3Q+rvdY3lc8nj7YnwBhxb3iA==

Steps to reproduce

Upon opening the minimal reproduction link, the playground should immediately show the following error:

Maximum recursive updates exceeded in component <Repl>. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.

What is expected?

No error should occur.

What is actually happening?

It seems that triggering the ref's getter before the setter inside of config.errorHandler causes an infinite loop to occur.

However, if the getter is placed after the setter, the no such infinite loop is entered.

System Info

No response

Any additional comments?

The ref can be a global ref (not instantiated inside of the component) and it seems like the bug still occurs. In the minimal reproduction playground, the ref is created inside <script setup> for simplicity.

EDIT: Something else I forgot to add is that it seems the infinite loop is not entered when using onErrorCaptured, it only happens for config.errorHandler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🍰 p2-nice-to-havePriority 2: this is not breaking anything but nice to have it addressed.🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions