✅ Solved: .RIV files in public folder (Next JS)

Hi, I'm trying to source a .riv file from my public directory and it's never working. Ive seen other threads related to this but none of them seem to work for me.

Im using this version

"@rive-app/react-canvas": "^4.18.5",

I have this page.tsx code:

// app/editor/[id]/page.tsx
'use client';

import { useParams } from 'next/navigation';
import { useState } from 'react';
import RiveAnimation from '../../components/RiveAnimation';
import WrapperCard from '@/app/components/WrappingCard';

const EditorPage = () => {
  const params = useParams();
  const { id } = params;

  const [name, setName] = useState(`Wrapper ${id}`);
  const [description, setDescription] = useState(`Description for Wrapper ${id}`);

  return (
    <div className="p-8">
      <h1 className="text-2xl font-bold mb-4">Edit Wrapper: {id}</h1>

      <div className="mb-4">
        <label className="block text-sm font-medium text-gray-700">Name:</label>
        <input
          type="text"
          value={name}
          onChange={(e) => setName(e.target.value)}
          className="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
        />
      </div>

      <div className="mb-4">
        <label className="block text-sm font-medium text-gray-700">Description:</label>
        <textarea
          value={description}
          onChange={(e) => setDescription(e.target.value)}
          className="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
        />
      </div>

      <div className="border p-4 rounded-lg">
        <h2 className="text-lg font-semibold mb-2">Design Preview</h2>
        <div className="p-8 rounded-lg shadow-md">
          <RiveAnimation src="wraply.riv" />
        </div>
      </div>
    </div>
  );
};

export default EditorPage;

And the 'wraply.riv' is in my public folder:

 

My website is deployed in vercel. When i just run it using local host i get this:

 

If i try using a public hosted .riv file using a URL, it seems to work. However, i tried hosting my own riv file using google drive and this encountered the same issue as above.

 

Any ideas on how to fix the local directory fetching of riv files?

OR

Any ideas on where to online host a riv file that works? I just want this one file, so free hosting should work for me