t***@126.com
t***@126.com
  • 发布:2024-06-11 16:51
  • 更新:2024-07-11 09:40
  • 阅读:58

vite打包为dist后,Hubuildx不识别type="module",是Hubuildx不支持吗?

分类:HBuilderX

项目创建的5+app,然后把dist下所有文件粘贴 到5+app项目下的根目录了
下载 的最新版本Hbuilderx,然后运行为android模拟 器基座时,报错
打包后index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<script type="module" crossorigin src="./assets/index.7e0a5530.js"></script>
<link rel="modulepreload" href="./assets/vendor.3256011e.js">
<link rel="stylesheet" href="./assets/index.71fa43f3.css">
</head>
报错:
11:04:15.551 正在启动HBuilder调试基座...
11:04:21.997 应用【vprj】已启动
11:04:25.708 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 scripts per HTML spec. at assets/vendor.3256011e.js:0
11:04:25.746 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 scripts per HTML spec. at assets/index.7e0a5530.js:0

请问大佬,如何让Hbuilderx支持type="module"呢?

2024-06-11 16:51 负责人:无 分享
已邀请:
t***@126.com

t***@126.com (作者)

找到原因了,是模拟 器安卓系统webView版本低了,换安卓 12解决

要回复问题请先登录注册