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. ๋ณธ๋ฌธ

frontend/log

[์—๋Ÿฌ] 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
728x90
๋ฐ˜์‘ํ˜•

 

๐Ÿ“– ๋ชฉ์ฐจ

 

     


     

    ๋ฐ”๋‹๋ผ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ 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';



    ๐Ÿ’ก ๋Š๋‚€์ 

    ๋ฆฌ์•กํŠธ๋ผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๊ฐ€ ํ™•์‹คํžˆ ๊ฐœ๋ฐœ์ž ํŽธ์˜๋ฅผ ์œ„ํ•ด ๋งŒ๋“ค์–ด์กŒ๊ตฌ๋‚˜,,,
    ๋‹ค ์•Œ์•„์„œ ํ•ด์ฃผ๋Š”๊ฑฐ์˜€๊ตฌ๋‚˜,,,!!!

    728x90
    ๋ฐ˜์‘ํ˜•
    Comments