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.

Using responsive param created "Cannot read property 'length' of null" error

See original GitHub issue

Wavesurfer.js version(s):

"wavesurfer.js": "^2.0.5",

Browser version(s):

Mac Chrome 70

Code needed to reproduce the issue:

Using React, I load the below code. I noticed that the error only occurs with responsive: true. Commenting it out works cleanly.

this.wavesurfer = WaveSurfer.create({
        container: this.el,
        waveColor: color,
        progressColor: color,
        cursorColor: '#5173E7',
        cursorWidth: 3,
        barWidth: 1,
        responsive: true,
        height,
        audioRate
      })

Error it produces in console

Uncaught TypeError: Cannot read property 'length' of null
    at t.value (wavesurfer.min.js:6)
    at t.value (wavesurfer.min.js:6)
    at wavesurfer.min.js:6
    at wavesurfer.min.js:6
    at Array.forEach (<anonymous>)
    at t.value (wavesurfer.min.js:6)
    at wavesurfer.min.js:6
    at n (wavesurfer.min.js:6)
    at wrapped (index.js:3221)
value @ wavesurfer.min.js:6
value @ wavesurfer.min.js:6
(anonymous) @ wavesurfer.min.js:6
(anonymous) @ wavesurfer.min.js:6
value @ wavesurfer.min.js:6
(anonymous) @ wavesurfer.min.js:6
n @ wavesurfer.min.js:6
wrapped @ index.js:3221
setTimeout (async)
(anonymous) @ index.js:3430
l @ wavesurfer.min.js:6
wrapped @ index.js:3221

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13

github_iconTop GitHub Comments

2reactions
thijstriemstracommented, Nov 16, 2018

if you do not recognize that as a broken JS object, I don’t know what to say.

1reaction
sshadmandcommented, Nov 16, 2018

Sorry - I have lint, that was a copy paste mistake. Same error with the comma

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using responsive param created Cannot read property 'length ...
Using React, I load the below code. I noticed that the error only occurs with responsive: true . Commenting it out works cleanly....
Read more >
[Solved] TypeError: Cannot read property 'length' of null
This error indicates that the code is trying to compute the length property on a null variable. A null variable holds no or...
Read more >
TypeError: Cannot read property 'length' of null, how can i ...
Try using "input?.length" within your "for" loop. There is no "length" property to "input" so you get an error.
Read more >
Uncaught TypeError: Cannot read property of undefined
If you get undefined error, you need to make sure that which ever variables throws undefined error, is assigned a value to it....
Read more >
Cannot read property 'length' of undefined with AJAX Resonse
Hi,. I am facing a issue above when I update a column on data tables, here is my client side code var editor...
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