DEVLOG
[์๋ฌ] 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. ๋ณธ๋ฌธ
[์๋ฌ] 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.
meroriiDev 2023. 5. 15. 17:15
๐ ๋ชฉ์ฐจ
๋ฐ๋๋ผ ์๋ฐ์คํฌ๋ฆฝํธ๋ก SPA๋ฅผ ๊ตฌํํ๋ ์ค ๊ธฐ๋ณธ์ธํ ๋ถํฐ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ค...
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.
๐ก ์์ธ
๋ชจ๋์ importํ ๋ ํ์ฅ์๋ช , ๊ฒฝ๋ก ์ง์ ์ ์ ๋๋ก ์ ๋ ฅํ์ง ์์์ ๋ฐ์ํ๋ ์๋ฌ๋ค.
๋ฆฌ์กํธ์์๋ ๋ชจ๋ import ์ .js, ./๋ฅผ ์๋ตํด๋ ๋๋ค. ํ์ง๋ง ์์ ์๋ฐ์คํฌ๋ฆฝํธ์์ importํ ๋์๋ ๋ฆฌ์กํธ์ฒ๋ผ ํ๋ฉด ์๋ฌ๊ฐ ๋ฐ์ํ๋ค.
๐ก ํด๊ฒฐ ๋ฐฉ๋ฒ
๊ฒฝ๋ก, ํ์ฅ์๋ช
๋ฑ ๋ชจ๋ ์ ๋ณด๋ฅผ ์๋ต์์ด ์
๋ ฅํด์ฃผ๋ฉด ๋๋ค!
โ import App from './App';
โ import App from 'App';
โญ๏ธ import App from './App.js';
๐ก ๋๋์
๋ฆฌ์กํธ๋ผ๋ ๋ผ์ด๋ธ๋ฌ๊ฐ ํ์คํ ๊ฐ๋ฐ์ ํธ์๋ฅผ ์ํด ๋ง๋ค์ด์ก๊ตฌ๋,,,
๋ค ์์์ ํด์ฃผ๋๊ฑฐ์๊ตฌ๋,,,!!!