cannot call Set#intersection for set with Proxy
Author: sevenc-nanashiCreated Jul 18, 2024Updated Sep 5, 2026
Labelsscope: reactivityhas workaround🔩 p2-edge-case
Vue version
fd5c001
Link to minimal reproduction
Steps to reproduce
- Create a set with Proxy, such as
ref(new Set([...])) - Call
Set#intersection
What is expected?
It shouldn't throw an error
What is actually happening?
It throws error: "Set operation called on non-Set object"
System Info
Vue: fd5c001
TypeScript: 5.5.3
Any additional comments?
There is a workaround: toRaw(mySet.value).intersection does not throw error.
Source: vuejs/core