![](/img/trans.png)
[英]Vue.js 3 - “Failed to load module script: The server responded with a non-JavaScript MIME type of ”text/html"
[英]Failed to load module script: The server responded with a non-JavaScript, CSS MIME type of “text/x-scss”
各位,
我收到了教授的一些代碼。 在本地運行 liveserver 時,js 在瀏覽器終端中給我一個錯誤。
Failed to load module script: The server responded with a non-JavaScript, CSS MIME type of "text/x-scss". Strict MIME type checking is enforced for module scripts per HTML spec.
我從未在 javascript 中實現 css 文件,而且我從未使用過 scss,所以我不知道如何解決這個問題。 我希望這里有人知道如何幫助我。
問候
您需要使用 node-sass 或 webpack 之類的工具將 scss 文件編譯為 css,然后在您的項目中引用它。
sass 在發送到瀏覽器之前使用編譯器編譯為 css。 瀏覽器不知道如何處理 scss 文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.