[英]Failed to load module script: The server responded with a non-JavaScript, CSS MIME type of “text/x-scss”
Hery guys,各位,
I received a bit of code by my professor.我收到了教授的一些代码。 When running the liveserver localy, the js is giving me an error in the browser terminal.在本地运行 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.
I have never implemented css files in the javascript and I never used scss so I dont know how to work with this issue.我从未在 javascript 中实现 css 文件,而且我从未使用过 scss,所以我不知道如何解决这个问题。 I hope someone here knows how to help me.我希望这里有人知道如何帮助我。
greetings问候
You will need to use a tool like node-sass or webpack to compile the scss file into css, and then reference that in your project.您需要使用 node-sass 或 webpack 之类的工具将 scss 文件编译为 css,然后在您的项目中引用它。
https://sass-lang.com/guide https://sass-lang.com/guide
sass is compiled to css using a compiler before being sent to the browser. sass 在发送到浏览器之前使用编译器编译为 css。 Browsers don't know what to do with scss files.浏览器不知道如何处理 scss 文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.