EchoEcho
EchoEcho
  • 发布:2023-10-20 17:43
  • 更新:2023-10-21 16:33
  • 阅读:470

【报Bug】uniapp x 在HBuilderX-alpha升级到3.93.2023101913-alpha,运行报错

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

手机系统: Android

手机系统版本号: Android 10

手机厂商: 一加

手机机型: 一加5

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

创建一个项目,然后运行

预期结果:

项目能跑起来运行成功

实际结果:

实际报错
···

17:37:48.692 项目 demo_uts 开始编译
17:37:49.617 node:internal/modules/cjs/loader:959
17:37:49.617 throw err;
17:37:49.617 ^
17:37:49.617
17:37:49.617 Error: Cannot find module 'mime/lite'
17:37:49.617 Require stack:
17:37:49.617 - D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\vite\plugins\vitejs\plugins\asset.js
17:37:49.617 - D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\vite\utils\plugin.js
17:37:49.617 - D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\vite\utils\index.js
17:37:49.617 - D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\mp\usingComponents.js
17:37:49.617 - D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\mp\index.js
17:37:49.617 - D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\index.js
17:37:49.617 - D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\index.js
17:37:49.617 - D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\bin\uni.js
17:37:49.618 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
17:37:49.618 at Function.Module._resolveFilename (D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\module-alias\index.js:49:29)
17:37:49.618 at Function.Module._load (node:internal/modules/cjs/loader:804:27)
17:37:49.618 at Module.require (node:internal/modules/cjs/loader:1028:19)
17:37:49.618 at require (node:internal/modules/cjs/helpers:102:18)
17:37:49.618 at Object.<anonymous> (D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\vite\plugins\vitejs\plugins\asset.js:32:32)
17:37:49.618 at Module._compile (node:internal/modules/cjs/loader:1126:14)
17:37:49.618 at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
17:37:49.618 at Module.load (node:internal/modules/cjs/loader:1004:32)
17:37:49.618 at Function.Module._load (node:internal/modules/cjs/loader:839:12) {
17:37:49.618 code: 'MODULE_NOT_FOUND',
17:37:49.618 requireStack: [
17:37:49.618 'D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\vite\plugins\vitejs\plugins\asset.js',
17:37:49.618 'D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\vite\utils\plugin.js',
17:37:49.618 'D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\vite\utils\index.js',
17:37:49.618 'D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\mp\usingComponents.js',
17:37:49.618 'D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\mp\index.js',
17:37:49.618 'D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\index.js',
17:37:49.618 'D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\index.js',
17:37:49.618 'D:\program\HBuilderX.3.91.2023092719-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\bin\uni.js'
17:37:49.618 ]
17:37:49.618 }
17:37:49.621 已停止运行...

···

bug描述:

uniapp x ,运行的时候报错,按照默认项目创建的 ,今天刚升级了HBuilderX-alpha,之前还能用,版本号:3.93.2023101913-alpha

2023-10-20 17:43 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

卸载HBuilderX或者HBuilderX内的uni-app x插件,重新安装试一下。

  • EchoEcho (作者)

    我删除了工具重新下载的还是不行,报错信息如下:


    18:27:46.374 项目 demo_uts 开始编译

    18:27:47.328 正在下载编译工具,请稍后...

    18:28:43.140 编译工具下载成功

    18:28:45.254 undefined:1

    18:28:45.254

    18:28:45.254

    18:28:45.255 SyntaxError: Unexpected end of JSON input

    18:28:45.255 at JSON.parse (<anonymous>)

    18:28:45.255 at parseScripts (D:\program\HBuilderX.3.93.2023101913-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\scripts.js:13:22)

    18:28:45.255 at initCustomScripts (D:\program\HBuilderX.3.93.2023101913-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\utils.js:261:54)

    18:28:45.255 at initEnv (D:\program\HBuilderX.3.93.2023101913-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\utils.js:91:5)

    18:28:45.255 at CAC.runDev (D:\program\HBuilderX.3.93.2023101913-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\action.js:42:25)

    18:28:45.255 at CAC.runMatchedCommand (D:\program\HBuilderX.3.93.2023101913-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\cac\dist\index.js:614:34)

    18:28:45.255 at CAC.parse (D:\program\HBuilderX.3.93.2023101913-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\cac\dist\index.js:541:12)

    18:28:45.255 at Object.<anonymous> (D:\program\HBuilderX.3.93.2023101913-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\index.js:57:5)

    18:28:45.255 at Module._compile (node:internal/modules/cjs/loader:1126:14)

    18:28:45.256 at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)

    18:28:45.296 已停止运行...

    2023-10-20 18:29

aisibi

aisibi - cs

同问题。私信工作人员qq 一直没回复

SingmyAaronLan

SingmyAaronLan

同问,刚升级完运行就报错,只能切换到上一版本

DCloud_HB_Resource

DCloud_HB_Resource

发现同类问题请提供运行日志并把plugin下的对应插件目录打包发上来

DCloud_HB_Resource

DCloud_HB_Resource

还有%appdata%的HBuilder X也打包给我吧

  • EchoEcho (作者)

    local下的HBuilder X还是Roaming下的HBuilder X

    2023-10-21 10:47

DCloud_HB_Resource

DCloud_HB_Resource

问题已经修复,如果遇到mime/lite无法加载的问题,有两种解决办法,

  1. 切换到上一个版本后,删除目录下的update目录,再次启动hx,进行升级操作
  2. 直接在插件管理中删除vue3编译工具,再次下载vue3编译工具
  • EchoEcho (作者)

    我把程序删除,重新解压,打开,插件也是新安装的还是报错:


    16:59:43.506 项目 demo_uts 开始编译

    16:59:48.703 undefined:1

    16:59:48.704

    16:59:48.704

    16:59:48.704 SyntaxError: Unexpected end of JSON input

    16:59:48.704 at JSON.parse (<anonymous>)

    16:59:48.704 at parseScripts (D:\program\HBuilderX-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\uni-cli-shared\dist\scripts.js:13:22)

    16:59:48.704 at initCustomScripts (D:\program\HBuilderX-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\utils.js:261:54)

    16:59:48.704 at initEnv (D:\program\HBuilderX-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\utils.js:91:5)

    16:59:48.704 at CAC.runDev (D:\program\HBuilderX-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\action.js:42:25)

    16:59:48.704 at CAC.runMatchedCommand (D:\program\HBuilderX-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\cac\dist\index.js:614:34)

    16:59:48.704 at CAC.parse (D:\program\HBuilderX-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\cac\dist\index.js:541:12)

    16:59:48.705 at Object.<anonymous> (D:\program\HBuilderX-alpha\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\index.js:57:5)

    16:59:48.705 at Module._compile (node:internal/modules/cjs/loader:1126:14)

    16:59:48.705 at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)

    2023-10-21 17:00

要回复问题请先登录注册