wavedrom
wavedrom copied to clipboard
Uncaught TypeError: e.charCodeAt is not a function
On the latest chrome, when using the editor with the following JSON;
{
"reg_definition": {
"reg_name": "DATA",
"reg_description": "Data from the last SETUP packet. It will be 10 bytes long, because it will include the CRC16. This is a FIFO; use `DATA_ACK` to advance the queue.",
"reg": [
{ "name": "DATA", "bits": 8, "attr": "RO", "description": "The next byte of SETUP data" }
]
}
}
I get the following error in the Chrome console;
Uncaught TypeError: e.charCodeAt is not a function
at t.exports (wavedrom.min.js:3)
at t.exports (wavedrom.min.js:3)
at t.exports (wavedrom.min.js:3)
at t.exports (wavedrom.min.js:3)
at t.exports (wavedrom.min.js:3)
at t.exports (wavedrom.min.js:3)
at Object.t.exports [as EditorRefresh] (wavedrom.min.js:3)
at c (init.js:129)
It should more like:
{
"reg": [
{"name": "DATA", "bits": 8, "attr": "RO", "description": "The next byte of SETUP data" }
]
}
@drom Any chance the editor could report that you have invalid JSON / it doesn't understand the JSON output?
Good idea. We should be able to check WaveJSON schema https://github.com/wavedrom/schema before trying to render.
I just ran into this issue after upgrading wavedrom -- the older version worked, but the newer version silently failed with only that error in the console -- TypeError: e.charCodeAt is not a function
Could there be a more descriptive error generated when JSON isn't valid? In this case, there were trailing commas, which wavedrom apparently used to accept but now no longer does.