Skip to content

fix: hasOwnProperty is not a function issue from json-big - #1103

Merged
czgu merged 1 commit into
pinterest:masterfrom
jczhong84:fix/jsonbig
Dec 16, 2022
Merged

fix: hasOwnProperty is not a function issue from json-big#1103
czgu merged 1 commit into
pinterest:masterfrom
jczhong84:fix/jsonbig

Conversation

@jczhong84

Copy link
Copy Markdown
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