💡 한 줄 결론:
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
📚 참고자료
'돌멩이 하나 > 에러는 미래의 연봉' 카테고리의 다른 글
유틸리티 함수(비밀번호 유효성 검사) 및 테스트 코드 작성 (0) | 2023.04.07 |
---|---|
typescript 에러 모음 (0) | 2023.04.04 |
코드에 GitHub access token이 포함된 상태로 commit을 하면 어떻게 될까 (0) | 2023.01.31 |
[React] useEffect hook에서 async/await 쓰는 방법 (0) | 2023.01.09 |
배열의 push() 메소드는 무엇을 return할까? (0) | 2022.12.27 |