TypeError: Cannot read property 'canvasId' of undefined
See original GitHub issueHi,
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:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I suspect it might work with
this.$confetti.start({});
, but this should be fixed, thanks for pointing it out.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.