question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'canvas' of undefined

See original GitHub issue

We have been using waversurferjs to great success (thanks for this awesome library!). 😃 However, it suddenly stopped working and we have no idea why. There were no code changes on our end. It works when run locally on my laptop, but when I deploy to Heroku, we get the error:

vendor-ce0b1d3….js:21 Uncaught TypeError: Cannot read property 'canvas' of undefined
    at Object.updateDimensions (vendor-ce0b1d3….js:21)
    at Object.updateSize (vendor-ce0b1d3….js:21)
    at Object.setWidth (vendor-ce0b1d3….js:21)
    at Object.drawPeaks (vendor-ce0b1d3….js:21)
    at Object.drawBuffer (vendor-ce0b1d3….js:20)
    at Object.loadDecodedBuffer (vendor-ce0b1d3….js:20)
    at Object.<anonymous> (vendor-ce0b1d3….js:20)
    at Object.<anonymous> (vendor-ce0b1d3….js:20)
    at Object.<anonymous> (vendor-ce0b1d3….js:20)
updateDimensions @ vendor-ce0b1d3….js:21
updateSize @ vendor-ce0b1d3….js:21
setWidth @ vendor-ce0b1d3….js:21
drawPeaks @ vendor-ce0b1d3….js:21
drawBuffer @ vendor-ce0b1d3….js:20
loadDecodedBuffer @ vendor-ce0b1d3….js:20
(anonymous) @ vendor-ce0b1d3….js:20
(anonymous) @ vendor-ce0b1d3….js:20
(anonymous) @ vendor-ce0b1d3….js:20

This was working on Heroku last week, and it just stopped working, with no code changes on our our end. However, it still works on our local laptops, it’s only busted when wavesurfer is running inside our Ember app deployed to heroku. waversurfer inside our Ember app deployed to my local laptop works fine.

I have no idea how to debug this … the div it’s supposed to render into is definitely there. Any ideas?

Any help would be hugely appreciated!

Thanks. 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
thijstriemstracommented, Feb 1, 2017

does #945 fix it?

0reactions
joelpresencecommented, Jan 31, 2017

OK, I rolled back to a much older version of our code that seems to work on Heroku, so I will try to binary search to find what broke things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'canvas' of undefined - Stack Overflow
I am getting the following error: Uncaught TypeError: Cannot read property 'canvas' of undefined Does anywhone know how to fix this?
Read more >
cannot read property canvas of undefined · Issue #557 - GitHub
and I added the script for the chart with the options and data as the example of the pie chart. I am getting...
Read more >
Uncaught type error: cannot read property of undefined
I have a problem when updating datapoint in canvas chart. I get this error message: Uncaught TypeError: Cannot read property 'getTime' of ...
Read more >
Uncaught TypeError: Cannot read property 'async' of undefined
I hit the error below when try to load back the object into canvas. Any idea how to fix this? Uncaught TypeError: Cannot...
Read more >
TypeError: Cannot read property 'canvas' of null - Web
Description When a participant tries to share the screen by executing the below code, it throws error :“Cannot read property 'canvas' of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found