rive-react icon indicating copy to clipboard operation
rive-react copied to clipboard

Can't load rive file because of an error

Open FleetAdmiralJakob opened this issue 1 year ago • 5 comments

In rive.ts in the browser: image In rive.d.ts in the development enviroment (error is in line 176): image In Edge: image The React Component: image

FleetAdmiralJakob avatar Feb 20 '23 18:02 FleetAdmiralJakob

@FleetAdmiralJakob Sorry you're having troubles! The issue here is that the runtime cannot find your riv file. The src does not look to absolute paths from the file its used in. Rather, think of it as the path to the .riv file from the base of the deployed page. If you're using Next.JS, you might put the .riv in your public/ folder where those assets are exposed on your web application, and then you might specify:

src: 'old_star_to_new_star_yellow.riv'

zplata avatar Feb 22 '23 19:02 zplata

Okay, I changed it, but the problem persists. image

FleetAdmiralJakob avatar Mar 12 '23 06:03 FleetAdmiralJakob

Same issue here

Renesauve avatar Apr 01 '23 21:04 Renesauve

Got this to work from this thread:

https://github.com/rive-app/rive-react/issues/153#issuecomment-1416800429

Renesauve avatar Apr 01 '23 22:04 Renesauve

for us the fix was to use import instead of direct src: #132 React/Vite/Capacitor - but we are also using browser preview which is without Capacitor

MichalKurzewski avatar Feb 14 '24 15:02 MichalKurzewski