简体   繁体   English

加载模块脚本失败:服务器以非 JavaScript、CSS MIME 类型“text/x-scss”响应

[英]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.

相关问题 Vue.js 3 - “加载模块脚本失败:服务器以非 JavaScript MIME 类型“text/html”响应 - Vue.js 3 - “Failed to load module script: The server responded with a non-JavaScript MIME type of ”text/html" Flask:加载模块脚本失败:服务器以“text/html”的非 JavaScript MIME 类型响应 - Flask: Failed to load module script: The server responded with a non-JavaScript MIME type of “text/html” 无法加载模块脚本:服务器以“text/plain”的非 JavaScript MIME 类型响应 - Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain" 加载模块脚本失败:服务器以“text/plain”的非 JavaScript MIME 类型响应。 对模块强制执行严格的 MIME 类型检查 - Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module 加载模块脚本失败:服务器以非 JavaScript MIME 类型“”响应。 强制执行严格的 MIME 类型检查 - Failed to load module script: The server responded with a non-JavaScript MIME type of “”. Strict MIME type checking is enforced 加载模块脚本失败:服务器以“text/plain”的非 JavaScript MIME 类型响应。 严格的 MIME 类型检查 i - Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking i 加载模块脚本失败:服务器响应非 JavaScript MIME 类型“” - Failed to load module script: The server responded with a non-JavaScript MIME type of "" 从'./image.jpeg'结果导入图像无法加载模块脚本服务器以非JavaScript MIME类型“ image / jpegerror”响应 - Import image from './image.jpeg' results Failed to load module script The server responded with a non-JavaScript MIME type of "image/jpegerror 服务器以“text/html”的非 JavaScript MIME 类型响应 - 节点 - The server responded with a non-JavaScript MIME type of "text/html" - Node 无法加载模块脚本:需要 JavaScript 模块脚本,但服务器响应 MIME 类型为“text/html” - Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM