React-Typescript unable to import video file
I'm trying to import an mp4 file for embedding on my website, but I get an error when I try to import it.
Cannot find module '../assets/robotShowcase.mp4' or its corresponding type declarations.
This is despite being able to import image and svg files.
While googling, I found a post with a similar question where the problem was solved by moving the file to the public folder in the root folder of the project, but after trying it, I got the same error.
Here's some example code:
import React from 'react';
import Worm from '../assets/Worm.png'
import Logo from '../assets/logo.svg'
import RobotShowcase from '../assets/robotShowcase.mp4'; //Error
function Home() {
return (
);
}
export default Home;