Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/pla

常用各类软硬件使用技巧、疑难、最新资讯等相关交流
rungod
帖子: 43
注册时间: 2010-06-19 3:51

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/pla

帖子 rungod »

使用pdf.js中出现错误:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
屏幕截图 2024-07-19 105901.jpg
解决方法:
编辑apache服务器配置文件:httpd.conf,
添加以下代码来设置 MIME 类型:
AddType application/javascript .mjs
屏幕截图 2024-07-19 111012.jpg
心海质水
回复