-
-
Notifications
You must be signed in to change notification settings - Fork 451
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 error in collectTypes method #343
Conversation
`obj.hasOwnProperty` can sometimes be undefined even though `obj` is an actual object, see this conversation over in another repo for reference: domchristie/humps#35 I am (somehow through a million hoops) running into this in my project, and their suggested fix of using `Object.prototype.hasOwnProperty.call(obj, key)` works beautifully and fixes my issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, nice find!
Any chance somebody could cut a release? 🙏 |
cc @andyrichardson ❓ |
Friendly ping we are blocked by this right now 😊 |
Makes sense and looks good to me! I suspect we had this conditional for TS reasons rather than runtime execution? Can't reproduce type errors on my end without the conditional so maybe this has been addressed in later updates. Either way, let's get this merged and look into that later 👍 |
Thank you @andyrichardson! A release would be great 🙏 |
@mxstbr I'll aim to get a release out tonight! |
Closes #2138 From time to time, Formik may be passed Object-like data that does not inherit from the Object prototype. In these cases, hasOwnProperty is not defined, and prepareDataForValidation will throw. The fix is to use Object.prototype to call hasOwnProperty on the data. See urql-graphql/urql#343
Closes #2138 From time to time, Formik may be passed Object-like data that does not inherit from the Object prototype. In these cases, hasOwnProperty is not defined, and prepareDataForValidation will throw. The fix is to use Object.prototype to call hasOwnProperty on the data. See urql-graphql/urql#343
Closes #2138 From time to time, Formik may be passed Object-like data that does not inherit from the Object prototype. In these cases, hasOwnProperty is not defined, and prepareDataForValidation will throw. The fix is to use Object.prototype to call hasOwnProperty on the data. See urql-graphql/urql#343
Closes #2138 From time to time, Formik may be passed Object-like data that does not inherit from the Object prototype. In these cases, hasOwnProperty is not defined, and prepareDataForValidation will throw. The fix is to use Object.prototype to call hasOwnProperty on the data. See urql-graphql/urql#343
Closes #2138 From time to time, Formik may be passed Object-like data that does not inherit from the Object prototype. In these cases, hasOwnProperty is not defined, and prepareDataForValidation will throw. The fix is to use Object.prototype to call hasOwnProperty on the data. See urql-graphql/urql#343
obj.hasOwnProperty
can sometimes be undefined even thoughobj
is an actual object, see this conversation over in another repo for reference: domchristie/humps#35I am (somehow through a million hoops) running into this in my project, and their suggested fix of using
Object.prototype.hasOwnProperty.call(obj, key)
works beautifully and fixes my issue.