Closed simlist closed 1 year ago
When I try to parse the data from a stream-error event into json I get the following error:
Uncaught SyntaxError: Expected property name or '}' in JSON at position 1
The error is caused by the strings in the data object having single quotes.
{'condition': 'forbidden', 'text': 'Permission denied to channels: orders', 'channels': ['orders']}
If I do JSON.parse(event.data.replaceAll("'", '"')) to replace the single quotes with double quotes, then there is no error.
JSON.parse(event.data.replaceAll("'", '"'))
Thanks for the report! This is now fixed.
Thank you very much! Great package.
When I try to parse the data from a stream-error event into json I get the following error:
The error is caused by the strings in the data object having single quotes.
If I do
JSON.parse(event.data.replaceAll("'", '"'))
to replace the single quotes with double quotes, then there is no error.