Cyberchef: JSON to CSV TypeError: e.replace is not a function

Created on 17 Sep 2019  路  9Comments  路  Source: gchq/CyberChef


Happens often, but not all the time. Get the following error when using "JSON to CSV"

'Unable to parse JSON to CSV: TypeError: e.replace is not a function`

Most helpful comment

I'd like to work on this, I'll check it out

All 9 comments

I'd like to work on this, I'll check it out

I'd like to work on this, I'll check it out

Looks like a lot of string replacement error handling.

https://github.com/gchq/CyberChef/search?p=2&q=e.replace&unscoped_q=e.replace

For JSON to Object I checked out cases where the number of properties was inconsistent from object to object.

Fails for the following pattern:
[ {A: 55, B: 55, C: 55}, {A: 55, B: 55 } ] extra properties in first object

Works fine for the following patterns:
[ {A: 55, B: 55 }, {A: 55, B: 55, C: 55} ] missing properties in first object
[ {A: 55, B: 55, C: 55}, {A: 55, B: 55, C: 55, D: 55} ] extra properties in second object or any later object

Same error in Version: 9.20.3.

Unable to parse JSON to CSV: TypeError: e.replace is not a function

I tried with and without JSON Beautify (which works fine by the way), and neither will convert to CSV.

Still happens

Still happens :-(

Same here. My JSON is beautified on SublimeText but fails with this same error on CyberChef.

Hello Team,
Still have this issue, someone have founnd a workaround, please ?
Thank you for help and great work.

I have hopefully fixed this in v9.27.3. If you are still getting errors, feel free to reopen this issue, but please include some example input that causes the error, otherwise it is difficult to know where exactly the problem lies.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gcmitec picture gcmitec  路  6Comments

wumb0 picture wumb0  路  3Comments

JakeAngell picture JakeAngell  路  7Comments

Oliboy50 picture Oliboy50  路  4Comments

farewell-ladmin picture farewell-ladmin  路  3Comments