简体   繁体   English

根据 HTML 规范对模块脚本强制执行严格的 MIME 类型检查

[英]Strict MIME type checking is enforced for module scripts per HTML spec

I get the following error in my JavaScript application:我的 JavaScript 应用程序中出现以下错误:

Failed to load module script: The server responded with a non-JavaScript MIME type of “application/octet-stream”.加载模块脚本失败:服务器以“application/octet-stream”的非 JavaScript MIME 类型响应。 Strict MIME type checking is enforced for module scripts per HTML spec.根据 HTML 规范对模块脚本强制执行严格的 MIME 类型检查。

How can I get my scripts to run?如何让我的脚本运行?

In your nginx config file add the following line:在您的 nginx 配置文件中添加以下行:

server {
    ...
    default_type application/javascript;
    ...
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试导入项目时出现错误“对每个 HTML 规范的模块脚本强制执行严格的 MIME 类型检查” - Getting error "Strict MIME type checking is enforced for module scripts per HTML spec" when trying to import project Express 错误:根据 HTML 规范对模块脚本执行严格的 MIME 类型检查 - Express error: Strict MIME type checking is enforced for module scripts per HTML spec 服务器以“application/octet-stream”的非 JavaScript MIME 类型响应 每个 HTML 对模块脚本强制执行严格的 MIME 类型检查 - The server responded with a non-JavaScript MIME type of "application/octet-stream" Strict MIME type checking is enforced for module scripts per HTML 加载模块脚本失败:服务器以非 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 类型检查 - 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 Python Flask - 错误:“加载模块脚本失败。强制执行严格的 MIME 类型检查”。 适用于生产环境,而不是本地服务器 - Python Flask - Error: "Failed to load module script. Strict MIME type checking is enforced". Works on production, not on the local server javascript:MIME类型(&#39;text / html&#39;)无法执行,并且启用了严格的MIME类型检查 - javascript: MIME type ('text/html') is not executable, and strict MIME type checking is enabled 拒绝执行脚本,因为 MIME 类型('text/html')不可执行,并且启用了严格的 MIME 类型检查 - Refused to execute script because MIME type ('text/html') is not executable, and strict MIME type checking is enabled Dropbox:MIME 类型 (&#39;text/html&#39;) 不可执行,并且启用了严格的 MIME 类型 &gt; 检查 - Dropbox: MIME type ('text/html') is not executable, and strict MIME type > checking is enabled 拒绝应用“ <URL> &#39;,因为它的MIME类型(&#39;text / html&#39;)不是受支持的样式表MIME类型,并且启用了严格的MIME检查 - Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM