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

JeongInHuh·2023년 10월 23일
0

에러

목록 보기
1/4

Vanilla 자바스크립트로 SPA 구현중 만난 에러

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

발생 원인

웹 개발과 관련된 에러로, JavaScript 모듈 스크립트를 로드하려고 할 때 발생할 수 있다. 이 메시지는 "예상한 것은 JavaScript 모듈 스크립트였지만 서버가 'text/css' MIME 유형으로 응답해서 생긴 에러라는 뜻이다.



해결 방법

아래처럼 css파일 import 해오는 부분 주석처리했다
이후, html 파일에서 css 파일 포함시키면 되니깐

비슷한 오류시 이분 글 참조

profile
컴퓨터공학부 대학생. 4학년. velog 꾸미기 : https://velog.io/@ybkim3603/Velog벨로그-사용법-튜토리얼 Git컨벤션: https://velog.io/@shin6403/Git-git-커밋-컨벤션-설정하기 커리어 방향 설정 모음글:https://velog.io/@eon7500/커리어-방향성-설정에-도움되는-글

0개의 댓글