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.

TypeError: Cannot read property 'canvasId' of undefined

See original GitHub issue

Hi,

I’m currently experiencing an issue with use your custom component.

Currently, I’m using the example you provided in your README. For some reason, I’m constantly facing this issue when testing on Google Chrome:

vue.esm.js?efeb:628 
[Vue warn]: Error in v-on handler: 
"TypeError: Cannot read property 'canvasId' of undefined"

Currently, my code looks like this in one of my components:

<template>
<main>
    <div class="home">
        <img src="../assets/avataaars.svg">
        <h1>Hello, I'm {{ name }}!</h1>
        <h3>Student. Developer. Artist.</h3>
        <button @click='start'>Throw Confetti!</button>
        <button @click='stop'>No More Confetti</button>
    </div>
  </main>
</template>

<script>
import Vue from 'vue';
import VueConfetti from 'vue-confetti';

Vue.use(VueConfetti);

export default {
  name: 'Home',
  data() {
    return {
      name: 'Mark Babatunde',
    };
  },
  methods: {
    start() {
      this.$confetti.start();
    },
    stop() {
      this.$confetti.stop();
    },
  },
};
</script>

If you have suggestions on figuring out this issue, I would greatly appreciate it.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
alexandermendescommented, Aug 22, 2019

Ah, I suspect it might work with this.$confetti.start({});, but this should be fixed, thanks for pointing it out.

0reactions
alexandermendescommented, Sep 29, 2019

Have just pushed up a fix for the original confetti.start issue. Closing this as the subsequent issue seemed to be something else. Feel free to reopen if it’s still an issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Got Uncaught TypeError: Cannot read property 'getContext' of ...
Got Uncaught TypeError: Cannot read property 'getContext' of undefined or null when try to clear a canvas [duplicate] ; name · "viewport" ;...
Read more >
TypeError: Cannot read property 'canvas' of undefined #160
Unfoftunatly I get error everytime TypeError: Cannot read property 'canvas' of undefined My gcode commands G29 G32 @BEDLEVELVISUALIZER ...
Read more >
Uncaught TypeError: Cannot read property 'async' of undefined
I've created a custom class with a custom property called "id". The code is like this: <canvas id="main-canvas" width="300" height="300" style="border:1px ...
Read more >
Cannot read property 'labels' of undefined
Target__c.value is not returning undefined. there are several ways of doing this: 1.- undefined check using typeof.
Read more >
TypeError: Cannot read property 'getContext' of Null in JS
The "Cannot read property 'getContext' of null" error occurs for 2 reasons: Calling the getContext method on a non-existent canvas element. Inserting the...
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