PNG in rive.riv throws errors
Hello, I am new to Rive and I was wondering if someone could help me out? I have a problem with using a file.riv in my JavaScript. I use a file.riv file that uses a PNG image, but I get the following error when I run my code:
Invalid artboard name or no default artboard
and Uncaught TypeError: Cannot read properties of undefined (reading 'animations')
This makes it that I cannot see my rive art in my webpage. I tried to solve this by explicitly inputting the artboard with the following code (now commented out), but that did not work:
const r = new rive.Rive({
src: "./rive.riv",
canvas: document.getElementById('canvas'),
// artboard: 'Person',
autoplay: true,
stateMachines: 'State Machine 1',
fit: rive.Fit.cover
});
The error does not occur when I do not use imported assets, and this problem also does not occur when I use a SVG file. I thought that png/jpg images used up too much memory, but I used a super small one and it still didn't work. Do you have any suggestions?
I use Windows and the webpage is on Chrome.
Hi
Thank you. Please find them in this repo alongside the code: https://github.com/dbecu/rive-test
Here's also the rive editor: https://rive.app/community/files/10415-19875-rive-test
The only thing that makes the error is having that hat in the hierarchy
Hi