I am trying to deploy a project to Vercel but it marks down an error on the building phase, saying react icons can t be found even if it is installed to package.json
and imported correctly to the component that uses that module.
Here is the public repository where is all my code since it planned to be public: https://github.com/Benevos/react-nextjs-tailwind-juice-slider
这是错误的组成部分:
use client ;
import React from react ;
import Link from "next/link";
import Navbar from "@/components/Navbar";
import { FaCircleUser } from "react-icons/fa6"; \ <---- Here is where the error shows
import { FaShoppingBag } from "react-icons/fa";
import { Londrina_Solid } from next/font/google ;
const londrinaSolid = Londrina_Solid({weight: 400 , subsets: [ latin ]});
function Header({ backgroundColor, textColor }) {
return (
<header id="header" style={{backgroundColor: backgroundColor, color: textColor}}
className={`flex justify-start items-center
py-4 font-semibold
relative transition duration-[1600ms] z-0`}>
<Link href={"/#"} className={`text-3xl flex-initial ml-10
max-md:ml-5 ${londrinaSolid.className}`}>
Trademark
</Link>
<Navbar/>
<div className="flex text-xl gap-4
flex-initial ml-auto
mr-10 max-md:mr-5">
<Link href={"/#"}>
<FaCircleUser/>
</Link>
<Link href={"/#"}>
<FaShoppingBag/>
</Link>
</div>
</header>
)
}
export default Header
http://code> Package.json:
{
"name": "juice-slider-vercel-fix",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "14.0.4",
"react": "^18",
"react-dom": "^18",
"react-icons": "^4.12.0",
"sass": "^1.69.5"
},
"devDependencies": {
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.0.4",
"postcss": "^8",
"tailwindcss": "^3.3.0"
}
}
单壳:
我用反应堆电灯文件建议进行指挥,以安装模块(npm 装置反应堆-save
)。
已经尝试启动一个新项目,在乞讨和进口所有源代码时安装反应堆信标,但仍未投入使用。
我还检查了。
有些人知道问题是什么?