冉娃娃
冉娃娃
  • 发布:2025-08-08 23:30
  • 更新:2025-08-08 23:30
  • 阅读:16

基于hbuilderx unicloud创建的模板项目无法修改成ts类型的文件

分类:HBuilderX

问题背景

使用IDE的hello-unicloud模板,创建了一个vue3的应用
但初始化的入口文件是js文件main.js
想要把它改成main.ts
结果运行到h5环境时就报错

错误内容

23:24:15.953 Compiling...  
23:24:16.443   vite v5.2.8 dev server running at:  
23:24:16.443   - Local:   http://localhost:5173/  
23:24:16.447   - Network: http://192.168.1.94:5173/  
23:24:16.447 Project client compiled successfully. Note You can view front-end run logs separately on the browser console.  
23:24:16.453 Click the debug icon (bug) in the upper right corner of the console to enable breakpoint debugging (Add breakpoints: Double-click the editor line number to add breakpoints)  
23:24:16.453 Web version FAQ reference: https://ask.dcloud.net.cn/article/35232  
23:24:16.454   ready in 784ms.  
23:24:16.703 Failed to load url /main.js (resolved id: /main.js). Does the file exist?  
23:24:17.063 Failed to load url /main.js (resolved id: /main.js). Does the file exist?  
23:24:17.093 Failed to load url /main.js (resolved id: /main.js). Does the file exist?

错误截图

2025-08-08 23:30 负责人:无 分享
已邀请:

要回复问题请先登录注册