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