移动端 企微自建应用 把pdf文件放到前端项目的static下 然后用iframe访问地址static/pdf/web/viewer.html 本地(桌面云内部 )可以 电脑uat(桌面云外)和手机上访问uat都不行 是为什么?
报错
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream". Strict MIME type checking is enforced for module scripts per HTML spec
搜了下是说网页中使用了模块脚本(module script),但服务器返回的 MIME 类型是 “text/html”,而不是 JavaScript 类型。根据 HTML 规范,严格的 MIME 类型检查会对模块脚本进行强制执行。
看了页面script应该是这两个地方
但是不知道该怎么改
没必要用 mjs 吧。所以这个问题也就不存在咯。
nginx 是修改 mime.types 什么的文件来支持 mjs 类型