๐Ÿšจ Refused to apply style from '~~~.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. ๐Ÿšจ

๋ฃธ์ž‰ยท2024๋…„ 9์›” 12์ผ
0

์ถฉ๊ฒฉ

Refused to apply style from '~~~.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
๋กœ์ปฌ์—์„  ์ž˜๋งŒ ๋Œ์•„๊ฐ€๋˜ ์ฝ”๋“œ๊ฐ€ ๋ฐฐํฌ ์‚ฌ์ดํŠธ์—์„œ ์—๋Ÿฌ๋ฅผ ๋ฑ‰๊ธฐ ์‹œ์ž‘ . .

์–ธ์  ๊ฐ€ ๋‹ค์‹œ ๋ฐœ์ƒํ•  ์ˆ˜๋„ ์žˆ๋Š” ์—๋Ÿฌ์ด๊ธฐ์— ๋˜ ์ด๋Ÿฐ ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚ฌ์„ ๋ฏธ๋ž˜์˜ ๋‚˜๋ฅผ ์œ„ํ•œ..
์ด๋Ÿฐ ์—๋Ÿฌ์™€ ์‹ธ์šฐ๊ณ  ์žˆ์„ ๋ˆ„๊ตฐ๊ฐ€๋ฅผ ์œ„ํ•œ..
ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ… Let's go ๐Ÿ”ฅ


๐Ÿ’ฌ ํ˜น์‹œ ๊นƒํ—ˆ๋ธŒ ๋กœ๊ทธ์ธ์ด ๋ฌธ์ œ ?

์šฐ๋ฆฌ ์„œ๋น„์Šค์—๋Š” ๊นƒํ—ˆ๋ธŒ ๋กœ๊ทธ์ธ ๊ธฐ๋Šฅ์ด ๊ตฌํ˜„๋˜์–ด์žˆ๋Š”๋ฐ, ๊นƒํ—ˆ๋ธŒ ๋ณด์•ˆ๋•Œ๋ฌธ์— ๋ฐฐํฌ ์‚ฌ์ดํŠธ์—์„œ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธฐ๋Š” ๊ฑด๊ฐ€ ์˜์‹ฌ์„ ํ–ˆ๋‹ค.
ํ˜„์žฌ ์„œ๋น„์Šค ๋ฐฐํฌ๊ฐ€ Cloudflare๋กœ ์ด๋ค„์ง€๊ณ  ์žˆ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ •ํ™•ํ•œ ๋ฌธ์ œ ํ™•์ธ์„ ์œ„ํ•ด ์„œ๋น„์Šค ๋ ˆํฌ๋ฅผ ํฌ๊ทธ ๋– ์„œ ๊ฐœ์ธ ๋ ˆํฌ๋กœ ๊ฐ€์ ธ์˜จ ๋’ค, ๋ฒ„์…€๋กœ ๋ฐฐํฌ๋ฅผ ํ•ด์„œ ๋ฒ„์…€ ๋ฐฐํฌ๋ณธ์œผ๋กœ ์„œ๋น„์Šค์— ์ ‘๊ทผํ•ด๋ณด์•˜๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ ์—ฌ์ „ํžˆ ๊ฐ™์€ ์—๋Ÿฌ ๋ฐœ์ƒ ..!!! ๐Ÿคฌ


๐Ÿง ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋กœ ๋‹ค์‹œ ๋Œ์•„๊ฐ€๋ณด์ž

Refused to apply style from '~~~.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋ฉด ์–ด๋–ค ํŒŒ์ผ์„ ๋ชป ์ฐพ๊ณ  ์žˆ๋‹ค๊ณ  ํ•˜๋Š”๋ฐ.. ์ด๊ฑธ ์ž์„ธํžˆ ๋ณด๋ฉด! ๋ฒˆ๋“ค ํŒŒ์ผ์ธ ๊ฑธ ์•Œ ์ˆ˜ ์žˆ๋‹ค

โžก๏ธ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€์— ์ฐพ์„ ์ˆ˜ ์—†๋‹ค๊ณ  ๋‚˜์˜จ ํŒŒ์ผ ๋ช…์ด dist > asset > js, css ํŒŒ์ผ ๋ช…๊ณผ ๋™์ผ
โžก๏ธ js ๋ฒˆ๋“ค ํŒŒ์ผ ํ•˜๋‚˜, css ๋ฒˆ๋“ค ํŒŒ์ผ ํ•˜๋‚˜
โžก๏ธ ์•„..! ์ง€๊ธˆ ๋ฒˆ๋“ค ํŒŒ์ผ์„ ๋ชป ์ฐพ๊ณ  ์žˆ๋Š” ๊ฒƒ์ด๊ตฌ๋‚˜ !! (๊นจ๋‹ฌ์Œ)


๐Ÿ’ฅ ๋ฌธ์ œ๋ฅผ ์ฐพ์€ ๊ฒƒ๋งŒ ๊ฐ™๋‹ค ..!

์•ž์„œ ์ ์€ ๊ฒƒ์ฒ˜๋Ÿผ ๋กœ์ปฌ์—์„  ์ž˜ ๋™์ž‘ํ•˜๋˜ ์ฝ”๋“œ๊ฐ€ ๋ฐฐํฌ๋ณธ์—์„œ๋งŒ ์ œ๋Œ€๋กœ ๋™์ž‘ํ•˜์ง€ ์•Š๋Š” ์ด์œ ์— ๋Œ€ํ•ด ๊ถ๊ธˆํ–ˆ์—ˆ๋Š”๋ฐ, ๋ฒˆ๋“ค๋Ÿฌ ๊ด€๋ จ ์—๋Ÿฌ๋ผ๋ฉด ์„ค๋ช…์ด ๊ฐ€๋Šฅํ–ˆ๋‹ค !

๋กœ์ปฌ์—์„  ๋นŒ๋“œ๋ฅผ ํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์•˜๊ณ , ๋ฐฐํฌ ํ™˜๊ฒฝ์—์„  ๋นŒ๋“œ ํ›„ ๋ฒˆ๋“ค๋ง ๊ณผ์ •์„ ์ˆ˜ํ–‰ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ๋ฐ–์— ์—†๋˜ ๊ฒƒ์ด๋‹ค..!!


dist๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋ฐฐํฌ๋ฅผ ํ•˜๋‹ˆ๊นŒ ๋ฒˆ๋“ค ํŒŒ์ผ ๊ฒฝ๋กœ๋Š” dist๋ฅผ root๋กœ ์ƒ๊ฐํ•œ๋‹ค.
์ •์ƒ์ ์ธ ํ•˜์œ„ ์ฃผ์†Œ๋Š” /asset/๋ฒˆ๋“คํŒŒ์ผ์ด ๋˜๊ณ , ๋ฒˆ๋“ค ํŒŒ์ผ ์š”์ฒญ์€ ๋ฐฐํฌ์ฃผ์†Œ/asset/๋ฒˆ๋“คํŒŒ์ผ๋กœ ๋“ค์–ด๊ฐ€์•ผ ์ •์ƒ์ ์œผ๋กœ ํŒŒ์ผ์„ ์ฐพ์„ ์ˆ˜ ์žˆ๋‹ค.


๐Ÿ‘€ ๊ทธ๋ ‡๋‹ค๋ฉด ์™œ ํŠน์ • ์ฃผ์†Œ์—์„œ๋งŒ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์„๊นŒ !?

์šฐ๋ฆฌ์˜ ๋ฐฐํฌ ์‚ฌ์ดํŠธ ๊ธฐ์ค€, ํ™ˆ ํ™”๋ฉด์—์„œ๋Š” ์œ„์—์„œ ๋งํ•œ ์ •์ƒ์ ์ธ ์ฃผ์†Œ(๋ฐฐํฌ์ฃผ์†Œ/asset/๋ฒˆ๋“คํŒŒ์ผ)๋กœ ์ ‘๊ทผํ•˜์—ฌ ๋ฒˆ๋“ค ํŒŒ์ผ์„ ์ž˜ ๋ถˆ๋Ÿฌ์˜ค๊ณ  ์žˆ์—ˆ๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ ํŠน์ • ์ฃผ์†Œ๋กœ ๋„˜์–ด๊ฐ”์„ ๊ฒฝ์šฐ์—๋Š” 'RequestURL: ๋ฐฐํฌ์ฃผ์†Œ + ํŠน์ • ์ฃผ์†Œ/asset/๋ฒˆ๋“คํŒŒ์ผ'์— ์ ‘๊ทผํ•˜์—ฌ ๋ฒˆ๋“ค ํŒŒ์ผ์„ ์š”์ฒญํ–ˆ๋‹ค.

๊ฒฐ๊ตญ, ๋น„์ •์ƒ์ ์ธ ๊ฒฝ๋กœ์—์„œ ๋ฒˆ๋“ค ํŒŒ์ผ์„ ์ฐพ์œผ๋ ค๊ณ  ํ•ด์„œ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋˜ ๊ฒƒ ..!!! ๐ŸŒŸ๐ŸŒŸ


๐Ÿซต ์ด๋Ÿฐ ์‚ฌ๋‹จ์ด ๋‚œ ์ด์œ  !

โžก๏ธ vite.cofig.js์˜ base ํ•„๋“œ๋ฅผ ์ฃผ๋ชฉํ•˜์ž ๐ŸŒŸ

vite.cofig.js์˜ base ํ•„๋“œ๋ฅผ ์ง€์ •ํ•˜๋ฉด ์ƒ๋Œ€ ๊ฒฝ๋กœ๋กœ ๋ฒˆ๋“ค ์œ„์น˜๋ฅผ ์žก๊ฒŒ ๋˜๋Š”๋ฐ, ํ™ˆ์œผ๋กœ ์ ‘๊ทผํ–ˆ์„ ๋•Œ๋Š” ์„œ๋ธŒ์ฃผ์†Œ๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์— "๋ฐฐํฌ์ฃผ์†Œ + /"๋ฅผ ๋ฃจํŠธ๋กœ ๋ณด๊ณ  ์ •์ƒ์ ์ธ ๋ฒˆ๋“ค๋Ÿฌ ์œ„์น˜์— ์ ‘๊ทผํ•œ๋‹ค.

ํ•˜์ง€๋งŒ, ์„œ๋ธŒ ์ฃผ์†Œ๋กœ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ๋œ ๊ฒฝ์šฐ์—๋Š” "๋ฐฐํฌ์ฃผ์†Œ + /์„œ๋ธŒ ์ฃผ์†Œ"๋ฅผ ๋ฃจํŠธ๋กœ ๋ณด๊ณ  ํ•ด๋‹น ์ฃผ์†Œ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋ฒˆ๋“ค์„ ์ฐพ์œผ๋ ค๊ณ  ํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ ๊ฒƒ์ด๋‹ค.


๐Ÿ˜ป ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

โžก๏ธ vite.cofig.js์˜ base ํ•„๋“œ ์ž์ฒด๋ฅผ ์ง€์›Œ๋ฒ„๋ฆฌ๊ธฐ !

base ํ•„๋“œ๋ฅผ ์ง€์šฐ๋ฉด ๋ฌด์กฐ๊ฑด ๋ฃจํŠธ ๊ฒฝ๋กœ๋ฅผ ์ ˆ๋Œ€ ๊ฒฝ๋กœ๋กœ ์ƒ๊ฐํ•˜๊ณ  ๋ฒˆ๋“ค ์œ„์น˜๋ฅผ ์žก๊ธฐ ๋•Œ๋ฌธ์—, ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค !!
(๋ฃจํŠธ ๊ฒฝ๋กœ๋ฅผ ์ ˆ๋Œ€ ๊ฒฝ๋กœ๋กœ ์ƒ๊ฐํ•˜๊ณ  ๋ฒˆ๋“ค ์œ„์น˜๋ฅผ ์žก๊ฒŒ ๋˜๋ฉด, ์–ด๋– ํ•œ ์„œ๋ธŒ URL์— ์ ‘๊ทผํ•˜๋”๋ผ๋„ ํ•ญ์ƒ ๋™์ผํ•œ ์œ„์น˜์— ๋ฒˆ๋“ค์ด ์žˆ์Œ์„ ๋ณด์žฅ ๊ฐ€๋Šฅ ๐ŸŒŸ๐ŸŒŸ)

๊ฒŒ๋น„์Šค์ฝ˜

0๊ฐœ์˜ ๋Œ“๊ธ€