🛠️ Solution

[Vercel, React] 프로젝트 배포 오류 - Error: Can't resolve '@fortawesome/fontawesome-svg-core

kimgoat 2024. 1. 13. 15:04

Error Messge

Module not found: Error: Can't resolve '@fortawesome/fontawesome-svg-core' in ' /vercel/path/node_modules/@fortawesome/react-fontawesome

 

React로 npm start해서 개발하는 과정에는 문제가 없다가 해당 프로젝트를 Vercel로 배포하는 과정에서 위와 같은 오류 메세지가 떴다.

 

 

원인

아이콘을 작동시키는데에 있어서 핵심 패키지인  @fortawesome/fontawesome-svg-core을 배포할 프로젝트에 설치하지 않아서 생긴 오류이다.

 

[Website] 출처: https://fontawesome.com/docs/web/dig-deeper/svg-core

 

 

해결방법

@fortawesome/fontawesome-svg-core 패키지 설치

npm i --save @fortawesome/fontawesome-svg-core
npm install --save @fortawesome/free-solid-svg-icons
npm install --save @fortawesome/react-fontawesome
npm install --save @fortawesome/free-regular-svg-icons

 

 

설치해야 하는 패키지 중에 설치하지 않았던 @fortawesome/fontawesome-svg-core  @fortawesome/free-regular-svg-icons를 추가로 설치하였다.

 

 

 

 

추가로 해당 패키지를 설치한 다음에 다시 배포를 진행했더니 문제없이 배포가 완료되었다! 🎉

📌 Vercle로 배포한 프로젝트 보러가기 👉  https://github-profile-finder-of-kimgoat.vercel.app/

 

 

 

 

 

< 참조 >

- (edited Jul 8, 2022 at 14:03) Uncaught Error: Cannot find module '@fortawesome/free-regular-svg-icons' [Website] 검색경로: https://stackoverflow.com/questions/72910017/uncaught-error-cannot-find-module-fortawesome-free-regular-svg-icons