inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

174만명의 커뮤니티!! 함께 토론해봐요.

Refuse .. CSP 에러 발생하시는 분들 참고하세요

미해결

[React 1부] 만들고 비교하며 학습하는 React

1. npm 명령어로 http-server 패키지 설치 npm install -g http-server 2. 다음 1-vanilla/ 경로에서 http-server 명령어로 서버 실행 http-server 3. localhost:8080 또는 VPS_IP:8080으로 접속 (포트는 패키지 버전마다 다를 수 있음) 4. 만약 404 에러가 발생하는 js 파일 등등이 있다면, 아래 명령어로 누구나 접근할 수 있도록 권한 설정 후 서버 재실행 chmod 777 store.js (예시)

  • csp
  • MVC
  • react
최준혁 댓글 2 좋아요 3 조회수 540

Refused to load the font '<URL>' because it violates the following Content Security Policy directive: 에러

미해결

안녕하세요? 보시는 것 처럼, react(프론트)/nodejs(서버) 로 간단한 앱을 만들고 heroku에 배포했더니 Refused to load the font '<URL>' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'font-src' was not explicitly set, so 'default-src' is used as a fallback. Refused to load the font 'https://fonts.gstatic.com/s/sourcesanspro/v14/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'font-src' was not explicitly set, so 'default-src' is used as a fallback. 이런 오류 메세지가 계속 뜹니다. 많은 구글 결과 아래와 같이 메타태그를 넣어줘도 동일한 에러가 발생합니다. <meta http-equiv= "Content-Security-Policy" content= "default-src 'self' ; style-src 'self' 'unsafe-inline' https://fonts.gstatic.com/* data:; font-src 'self' data:; " > 정말 몇일 동안 ...이것만 붙들고 있는데도 해결이 안되네요 ㅠㅠ 아시는 분 부탁드립니다.

  • react
  • heroku
  • nodejs
  • deploy
  • csp
sw9142 댓글 1 좋아요 0 조회수 944

인기 태그

인프런 TOP Writers

주간 인기글