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: hasOwnProperty is not a function issue from json-big #1103

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

jczhong84
Copy link
Collaborator

Issue
The json column transformer somehow didn't work with error

Uncaught TypeError: e.hasOwnProperty is not a function
    at vendors-node_modules_lodash_sampleSize_js-node_modules_react-json-view_dist_main_js.1fa9e63d206dc9b137e1.js:209:107637
    at Array.forEach (<anonymous>)
    at a.renderObjectContents (vendors-node_modules_lodash_sampleSize_js-node_modules_react-json-view_dist_main_js.1fa9e63d206dc9b137e1.js:209:107544)

Cause
The parsed json object doesn't has functions like hasOwnProperty from the Object prototype.

Fix
As a workaround, we'll use object spread to copy the parsed json over to a plain Javascript object.

@czgu czgu merged commit 6435bc1 into pinterest:master Dec 16, 2022
rohan-sh1 pushed a commit to CAI-TECHNOLOGIES/cai-ext-db-explorer that referenced this pull request Feb 28, 2023
@jczhong84 jczhong84 deleted the fix/jsonbig branch April 7, 2023 00:40
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