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.

Ember.js Uncaught TypeError: Cannot set property 'fillStyle' of undefined

See original GitHub issue

Hey, so I’m trying to use WaveSurfer within my Ember.js project with no prevail(I doubt Ember is causing these issues).

I imported the latest version of wavesurfer.js through Bower, and then used this exact code in one of my templates:

    <div id="waveform"></div>
    <script>
        var wavesurfer = WaveSurfer.create({
            container: '#waveform',
            waveColor: 'red',
            progressColor: 'purple'
        });
        wavesurfer.load('assets/sound4.mp3');
    </script>

Now when I try to see if it works, my console errors saying Uncaught TypeError: Cannot set property 'fillStyle' of undefined.

Here’s what line in wavesurfer.js it’s erroring at:

    setFillStyles: function (entry) {
        entry.waveCtx.fillStyle = this.params.waveColor; <--- HERE
        if (this.hasProgressCanvas) {
            entry.progressCtx.fillStyle = this.params.progressColor;
        }
    },

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
davidchalifouxcommented, May 14, 2017

Hey, I just tried out the 2.0 beta and it’s working great! Good work!

0reactions
agamemnuscommented, May 5, 2017

Thank you. This was exactly the problem!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest import statement: 'TypeError: Cannot set property ' ...
The error occurs because jestdom is not able add canvas, which we need to do. For me this happened because I was using...
Read more >
TypeError: Cannot set property 'fillStyle' of null - Techy Things
TypeError : Cannot set property 'fillStyle' of null. Solution. https://www.npmjs.com/package/jest-canvas-mock. $ yarn add --dev jest-canvas- ...
Read more >
Set property on controller from within a component
I'm assuming this means that the property is being set in that view and not on the controller. I've tried setting it by...
Read more >
Computed property names cannot be received if set by a ...
[Solved]-Computed property names cannot be received if set by a numeric variable-babel.js. Search. score:3. This is a bug in the experimental babel plugin....
Read more >
UDN Search
the javascript exception "can't define property "x": "obj" is not extensible" occurs when object.preventextensions() marked an object as no longer extensible, ...
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