Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: e.charCodeAt is not a function #254

Open
mithro opened this issue Sep 2, 2019 · 4 comments
Open

Uncaught TypeError: e.charCodeAt is not a function #254

mithro opened this issue Sep 2, 2019 · 4 comments

Comments

@mithro
Copy link

mithro commented Sep 2, 2019

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)
@drom
Copy link
Member

drom commented Sep 3, 2019

It should more like:

{
  "reg": [
    {"name": "DATA", "bits": 8, "attr": "RO", "description": "The next byte of SETUP data" }
  ]
}

@mithro
Copy link
Author

mithro commented Sep 3, 2019

@drom Any chance the editor could report that you have invalid JSON / it doesn't understand the JSON output?

@drom
Copy link
Member

drom commented Sep 3, 2019

Good idea. We should be able to check WaveJSON schema https://github.com/wavedrom/schema before trying to render.

@xobs
Copy link

xobs commented Mar 16, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants