본문 바로가기
💻CODING/etc.

[web] netlify 배포 후 https 에러 해결

by 코딩하는 갓디노 2021. 12. 1.

netlify 배포 후 https 에러 해결

 

netlify에서 배포 하면서 
발생된 https 에러 입니다. 

 

react 프로그램을 netlify에서 배포를 한 후, 실행해보니, tweenmax is not defined 라는 오류가 나고
gsap, tweenmax를 이용한 애니메이션이 작동을 하지 않았습니다. 

좀 더 정확히 확인해 보니 아래의 오류 메시지가 떳습니다. 

 

오류 메시지

Mixed Content: The page at 'xxx' was loaded over HTTPS, but requested an insecure script 'http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js'. This request has been blocked; the content must be served over HTTPS. 

 

mixed content는 암호화된 HTTPS 기반의 사이트에서 암호화되지 않은 HTTP 사이트에 요청을 보내서 에러가 발생했습니다. 

 

해결 방법

해결 방법은 정말 간단합니다. index.html 파일 내에 아래의 코드를 삽입합니다. 

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
반응형

댓글