Release 1.3.0 causes
See original GitHub issueReferencing https://github.com/katspaugh/wavesurfer.js/issues/947 .
Sorry, I don’t mean to beat a dead horse, and I’m not trying to lay blame or be argumentative, but we locked down the version of wavesurfer.js to 1.2.8 and it works perfectly, no issues or crashes or anything. Then, without changing any of our code in any way, if we upgrade wavesurfer.js to 1.3.0 we get the following fatal error:
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)
// The error seems to be around here
e.start=e.waveCtx.canvas.offsetLeft/i||0,e.end=e.start+n/i,e.waveCtx.canvas.width=t,e.waveCtx.canvas.height=r,this.style(e.waveCtx.canvas,{width:n+"px"})
So to repeat, leaving our own code constant, with no changes: wavesurfer.js 1.2.8 no issues, wavesurfer.js 1.3.0 we get the crash above.
So something seems to have changed in wavesurfer.js between 1.2.8 and 1.3.0 that is causing this crash.
For now, I have changed my package.json from
"wavesurfer.js": "^1.2.8"
to
"wavesurfer.js": "1.2.8"
and we are not seeing the crash. But I would like to be on the latest version if possible.
I will try an experiment, and change our initialization from
let p = WaveSurfer.create({
container: `#${this.get('waveformId')}`,
waveColor: 'violet',
progressColor: 'purple',
barWidth: 1,
skipLength: 4
});
to
let p = WaveSurfer.create({
container: `#${this.get('waveformId')}`,
waveColor: 'violet',
progressColor: 'purple',
barWidth: 1,
skipLength: 4,
renderer: 'Canvas'
});
and then deploy wavesurfer.js 1.3.0 and report back.
I notice in the release notes that there is a remark about going to MultiCanvas, not sure if this is related? I do notice in https://github.com/katspaugh/wavesurfer.js/blob/02d99ab7ec4c576132ad6a19b3e4d227b084bbeb/src/wavesurfer.js that MultiCanvas became the default renderer whereas it was Canvas before. We were not setting the renderer in the options, so maybe this is the issue? Multicanvas is broken?
I am using Chrome 55.0.2883.95 (64-bit) on macOS 10.12.3. However, this crash in wavesurfer.js also happened in Firefox.
Any thoughts?
And thanks again for all the help and for making wavesurfer.js available - it is really awesome and we are grateful to use it! 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top GitHub Comments
OK, I just deployed wavesurfer.js 1.3.0 to heroku with
renderer: 'Canvas'
added to the initializer args, and now it works without the crash above.So wavesurfer.js 1.3.0 with default
MultiCanvas
renderer does not seem to work on heroku. Not sure why …I’m happy to help however you need me to, if you want to test patches, etc.
We are using node 6.9.1 and ember 2.9.0.
And to be clear, I’m worried that others might encounter this issue, that’s why I’m posting this …