-
Notifications
You must be signed in to change notification settings - Fork 31
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
Next.js 14 cannot load any .riv file #249
Comments
Same problem. Only solution I found for now is to use: "@rive-app/react-canvas": "^4.6.2", those work for me in the meantime |
works for me. Also highly doubt this has anything to do with next.js. Its just serving static files after all. |
I don't know but with last versions of rive in next js, if I use
The animations don't load and I get this error in the console:
works fine with those versions in my case:
|
I'm moving from Vite to Next, and the latest is working in our Vite project, but not with the latest of next.js 15 (we are going to try 14 too) receiving this error: Console Error Call Stack I also tried the older versions suggested above, but have not had luck, not sure if this is the best place though since this is 15 and not 14, and 15 is new. |
To follow-up on this, we figured out it was a CORS issue, it is working on next 15 for us, apologies for the false flag. |
NextJS: 14.1.4
@rive-app/react-canvas": "^4.9.0"
I already used Rive in other React apps with Vite and everything was working as intended. However, I cannot for the life of me makes things work with Next.js in that regard. Some Next.js devs seems to don't have any problem importing .riv files from public folder and I just don't understand what is different on my side.
I tried many solutions and none seems to work. I always get the dreaded "Bad header" and "Problem loading file; may be corrupt!".
The only way a Rive component seems to load is if I load it from an external source. The webpack or turbo bundler doesn't seems to find any .riv files in my public directory.
Here's what my code currently looks like :
I tried "rive/cube.riv" as an alternative or again importing it as module with the url-loader and the webpack rules. Nothing works. Is there any Next.js dev that have a workaround? I am at wits end here... Many thanks!
The text was updated successfully, but these errors were encountered: