![](/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.