You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tried upgrading to the latest version of json-2-csv (since the issue may already be fixed).
Hi, I've been trying to convert from a pretty nested and unstructured json file to a csv using this package and the expandArrayObjects: true option, but looks like it is unable to convert some objects in my data. This is pretty much the stack trace the server is throwing:
[1] TypeError: Cannot convert undefined or null to object
[1] at Function.keys (<anonymous>)
[1] at generateDeepKeysList (/repos/XXXX/node_modules/deeks/lib/deeks.js:42:23)
[1] at deepKeys (/repos/XXXX/node_modules/deeks/lib/deeks.js:19:16)
[1] at /repos/XXXX/node_modules/deeks/lib/deeks.js:35:20
[1] at Array.map (<anonymous>)
[1] at deepKeysFromList (/repos/XXXX/node_modules/deeks/lib/deeks.js:32:17)
[1] at processArrayKeys (/repos/XXXX/node_modules/deeks/lib/deeks.js:71:24)
[1] at /repos/XXXX/node_modules/deeks/lib/deeks.js:51:20
[1] at Array.map (<anonymous>)
[1] at generateDeepKeysList (/repos/XXXX/node_modules/deeks/lib/deeks.js:42:34)
Is there any workaround to do this? I've tried sanitizing the main keys, i.e. removing the first level keys with null|undefined value. But it looks like the problem is in a deeper level.
I wish I could share some data to test but I can't.
Thanks in advance
The text was updated successfully, but these errors were encountered:
mrodrig
added a commit
to mrodrig/deeks
that referenced
this issue
Nov 22, 2022
Initially reported in mrodrig/json-2-csv#222
This issue appears when a `null` value is passed for key enumeration because technically `null` is an object, but doesn't have keys. This commit fixes the issue by adding a null check to prevent the type error.
* fix: resolve "TypeError: Cannot convert undefined or null to object"
Initially reported in mrodrig/json-2-csv#222
This issue appears when a `null` value is passed for key enumeration because technically `null` is an object, but doesn't have keys. This commit fixes the issue by adding a null check to prevent the type error.
* chore(deps): npm audit fix
* chore(rel): 2.6.0
Thanks for your patience on this @gdonoso94. I just pushed a patch for this in the underlying deeks module that should resolve the issue. I'll be pushing out a new version of json-2-csv which updates to the patched version shortly as 3.18.0. Please let me know if you still run into the issue with that version. Thanks!
Background Information
latest
18.1.0
The issue I'm reporting is with:
I have...
Hi, I've been trying to convert from a pretty nested and unstructured json file to a csv using this package and the
expandArrayObjects: true
option, but looks like it is unable to convert some objects in my data. This is pretty much the stack trace the server is throwing:Is there any workaround to do this? I've tried sanitizing the main keys, i.e. removing the first level keys with null|undefined value. But it looks like the problem is in a deeper level.
I wish I could share some data to test but I can't.
Thanks in advance
The text was updated successfully, but these errors were encountered: