-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue while using with Vue 3 - Canvas not loaded #29
Comments
Hello, Let me know 👍 |
@jdnichollsc, Thanks for looking into this and for the pointers. I have added them now. But the problem persists. Please let me know when you find a solution, and what more things I can try meanwhile. |
UPDATE: The canvas is loading properly if I add the game object to mounted(). data() {
return {
initialize: true,
game: null,
};
},
mounted() {
this.game = {...} Is this the right way to solve this? Would there be any problem moving forward? Also, now I get the following warnings in the console,
I'm not sure if these warnings have anything to do with the changes I made. Please let me know if I should open a new issue for these. |
I think that's ok. are you using audio from your game? Some browsers like Chrome requires a gesture to enable audio from Canvas :) |
Good to know... 😃 The AudioContext error shows up even with the basic example code. But I think it would be great if you could guide me on getting rid of the following warning particularly, as it's running for every small change (like at every step of moving a range slider)!
|
Please let me know if this issue persist with the last version, thanks! |
It looks like I need to publish another package to support Vue3, stay tuned ionic-team/stencil-ds-output-targets#77 |
@VivianManohar I encountered the same problem just now, when I saw some source code of this repo, I found that the package is built for webpack , which means it's not compatible with vitejs app. So why not just using traditional vue cli -- @vue/cli to create a webpack-based vue3 app, turns out working fine for me. |
Hi,
When I try the given example with Vue 3, the canvas is not rendering on the browser. I only see a blank screen. On inspect elements, I see,
<div id="app" data-v-app=""> <ion-phaser game="[object Object]" initialize="true" class="hydrated"> </ion-phaser></div>
However, whenever I change something within the script tag (like adding a comment), the canvas immediately loads on the browser. But then it disappears again if I refresh the browser. I checked with different browsers as well.
Link to the Vue 3 code - not working
But the same code works fine with Vue 2,
Link to the Vue 2 code - working
Can you please tell me what should I do differently for Vue 3? I'm a newbie to programming, so apologies if I'm missing anything obvious. Thanks.
The text was updated successfully, but these errors were encountered: