Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to Safari Proxy bug #1

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Fix to Safari Proxy bug #1

merged 2 commits into from
Oct 23, 2023

Conversation

bornajazvo
Copy link

Fixes occasional Safari bug that causes a break in Vue if using Set. There doesn't seem to be a reliable way to recreate it, closest I got was opening and closing dev tools while the app is loading but the timing is very strict and inconsistent.

This setup:

data() {
  return {
    foo: new Set(),
  }
},
mounted() {
  console.log(this.foo.size);
}

results in:

Untitled

  • First log: target, key, and receiver
  • Second log: this
  • Third log: target
  • Errors

Seems like a Safari issue that on Reflect.get it turns the receiver Proxy into an object. Then it fails as target gets redefined assuming it’s a Proxy, and this returns undefined which errors when passed into Reflect.get.

This is the least disruptive fix to the bug, as we no longer rely on the Vue Proxy when checking size of Set.

Copy link

@alecgibson alecgibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please bump the version?

@bornajazvo bornajazvo merged commit c0297f5 into main Oct 23, 2023
1 check passed
@bornajazvo bornajazvo deleted the safari-proxy-fix branch October 23, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants