[해결] Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

박경호·2023년 10월 26일
0

미션

목록 보기
2/2

미션

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
  • 위 에러 해결

결과

  • 성공: 아파치 설정(httpd.conf)에 AddType application/javascript .js 를 입력하여 아파치 재실행 (systemctl restart httpd)
  • httpd.conf의 위치는 systemctl status httpd 를 하면 아파치 설치 경로가 나온다 그 안에서 찾으면 됩니다.
  • 일반적인 .js는 원래 파싱이 가능할텐데 문제가 되었던 부분은 .js:1에 import를 사용하고 있었습니다. 원래도 되던건데 최근 AddTpye MIME 설정을 한 적이 있어서 뭔가 꼬였던 듯.
profile
안녕하세요 나는 개발자 👨‍💻

0개의 댓글