돌멩이 하나/에러는 미래의 연봉

netlify 자동 배포 설정 오류 해결

미래에서 온 개발자 2023. 2. 14. 21:59

netlify deploy settings 화면

💡 한 줄 결론:
build command 란에 npm run build가 아닌 CI= npm run build을 입력해줘야 한다. (공백 주의)

 

 

1. npm run build 만 입력했을 때 deploy log

 

 

 

2. CI=npm run build (= 앞뒤에 공백없음) 입력했을 때 deploy log

 

 

이에 대한 netlify docs의 설명 :

In some cases, a build may fail due to a warning message that would not cause a build failure when run locally. This is because some libraries and build tools handle warnings differently when they detect that they are being run in a Continuous Integration (CI) environment.
Like many other CI tools and platforms, Netlify sets a build environment variable, CI=true, as a convention to indicate that your build is running in an automated environment. Many libraries use the presence of the CI variable to trigger changes in their behavior, such as removing progress spinner animations or user prompts. In some cases, a library may also choose to treat warning messages as errors, failing the build.
Generally, libraries that choose to fail on warnings presume their users will want to fix the issues causing the warnings. If this isn’t practical for your use case, you can override the CI variable by adding CI='' to the beginning of your site build command. For example: CI='' npm run build

 

 

 

📚 참고자료

 

Build troubleshooting tips

Find troubleshooting tips for failing builds, learn how to address certain build errors, and access additional support resources.

docs.netlify.com

 

 

[Netlify] Netlify로 React 프론트엔드 배포하기

배포...정말 무서운 단어다. AWS EC2, Netlify, Heroku 등등 검색하면 수많은 배포 방법이 나온다. 필자가 저 3개를 다 도전해본 결과 AWS는 어렵다..아직까지도 성공을 못했다. 그래서 구인구직 사이트를

velog.io