I am currently working on a portfolio, and there were no errors. However, when I imported a video, it gave me this error:
I’ve seen other posts talking about this, but everything I tried didn’t fix the error.
package.json:
{
"name": "portfolio",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"autoprefixer": "^10.4.19",
"axios": "^1.7.2",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"file-loader": "^6.2.0",
"framer-motion": "^11.3.8",
"next": "14.2.5",
"next-client-cookies": "^1.1.1",
"next-connect": "^0.12.1",
"openai": "^4.53.0",
"postcss": "^8.4.40",
"react": "^18",
"react-dom": "^18",
"react-parallax-mouse": "^2.1.0",
"react-query": "^3.39.3",
"react-scroll": "^1.9.0",
"tailwindcss": "^3.4.7",
"unsplash-js": "^7.0.19",
"url-loader": "^4.1.1",
"whatwg-fetch": "^3.6.20"
},
"devDependencies": {
"@babel/preset-env": "^7.25.0",
"eslint": "^8",
"eslint-config-next": "14.2.5"
},
"description": "This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).",
"main": "postcss.config.js",
"repository": {
"type": "git",
"url": "git+https://github.com/boblamceo/portfolio.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/boblamceo/portfolio/issues"
},
"homepage": "https://github.com/boblamceo/portfolio#readme"
}
next.config.json:
/** @type {import('next').NextConfig} */
const nextConfig = {
async headers() {
return [
{
// matching all API routes
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{
key: "Access-Control-Allow-Origin",
value: "https://api.limewire.com/api/image/generation",
},
{
key: "Access-Control-Allow-Methods",
value: "GET,DELETE,PATCH,POST,PUT",
},
{
key: "Access-Control-Allow-Headers",
value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version",
},
],
},
];
},
env: {
API_KEY: process.env.API_KEY,
},
};
export default nextConfig;
Import statement:
import AerodynamicVid1 from "../../public/achivements/projects/aerodynamic/A1.mp4";
What is the reason for this error? Is it because I need to do something when importing videos?