h***@163.com
h***@163.com
  • 发布:2024-08-14 12:11
  • 更新:2024-08-14 15:09
  • 阅读:142

【报Bug】uniapp vue3编译到android失败

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 4.24

手机系统: Android

手机系统版本号: Android 14

手机厂商: 小米

手机机型: mi14

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

12:06:20.494 项目 'liangtian-uni-app' 开始编译...
12:06:22.398 C:\Users\28267\Desktop\LT-uniapp\liangtian-uni-app\node_modules.store\@dcloudio+uni-cli-shared@3.0.0-4010520240507001\node_modules\@dcloudio\uni-cli-shared\dist\vite\plugins\vitejs\plugins\asset.js:87
12:06:22.402 const url = await fileToUrl(id, config, options?.isAndroidX
12:06:22.415 ^
12:06:22.418 SyntaxError: Unexpected token .
12:06:22.425 at Module._compile (internal/modules/cjs/loader.js:703:23)
12:06:22.427 at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
12:06:22.433 at Module.load (internal/modules/cjs/loader.js:628:32)
12:06:22.436 at Function.Module._load (internal/modules/cjs/loader.js:555:12)
12:06:22.441 at Module.require (internal/modules/cjs/loader.js:666:19)
12:06:22.444 at require (internal/modules/cjs/helpers.js:16:16)
12:06:22.449 at Object.<anonymous> (C:\Users\28267\Desktop\LT-uniapp\liangtian-uni-app\node_modules.store\@dcloudio+uni-cli-shared@3.0.0-4010520240507001\node_modules\@dcloudio\uni-cli-shared\dist\vite\utils\plugin.js:5:17)
12:06:22.452 at Module._compile (internal/modules/cjs/loader.js:759:30)
12:06:22.457 at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
12:06:22.462 at Module.load (internal/modules/cjs/loader.js:628:32)

预期结果:

12:06:20.494 项目 'liangtian-uni-app' 开始编译...
12:06:22.398 C:\Users\28267\Desktop\LT-uniapp\liangtian-uni-app\node_modules.store\@dcloudio+uni-cli-shared@3.0.0-4010520240507001\node_modules\@dcloudio\uni-cli-shared\dist\vite\plugins\vitejs\plugins\asset.js:87
12:06:22.402 const url = await fileToUrl(id, config, options?.isAndroidX
12:06:22.415 ^
12:06:22.418 SyntaxError: Unexpected token .
12:06:22.425 at Module._compile (internal/modules/cjs/loader.js:703:23)
12:06:22.427 at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
12:06:22.433 at Module.load (internal/modules/cjs/loader.js:628:32)
12:06:22.436 at Function.Module._load (internal/modules/cjs/loader.js:555:12)
12:06:22.441 at Module.require (internal/modules/cjs/loader.js:666:19)
12:06:22.444 at require (internal/modules/cjs/helpers.js:16:16)
12:06:22.449 at Object.<anonymous> (C:\Users\28267\Desktop\LT-uniapp\liangtian-uni-app\node_modules.store\@dcloudio+uni-cli-shared@3.0.0-4010520240507001\node_modules\@dcloudio\uni-cli-shared\dist\vite\utils\plugin.js:5:17)
12:06:22.452 at Module._compile (internal/modules/cjs/loader.js:759:30)
12:06:22.457 at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
12:06:22.462 at Module.load (internal/modules/cjs/loader.js:628:32)

实际结果:

12:06:20.494 项目 'liangtian-uni-app' 开始编译...
12:06:22.398 C:\Users\28267\Desktop\LT-uniapp\liangtian-uni-app\node_modules.store\@dcloudio+uni-cli-shared@3.0.0-4010520240507001\node_modules\@dcloudio\uni-cli-shared\dist\vite\plugins\vitejs\plugins\asset.js:87
12:06:22.402 const url = await fileToUrl(id, config, options?.isAndroidX
12:06:22.415 ^
12:06:22.418 SyntaxError: Unexpected token .
12:06:22.425 at Module._compile (internal/modules/cjs/loader.js:703:23)
12:06:22.427 at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
12:06:22.433 at Module.load (internal/modules/cjs/loader.js:628:32)
12:06:22.436 at Function.Module._load (internal/modules/cjs/loader.js:555:12)
12:06:22.441 at Module.require (internal/modules/cjs/loader.js:666:19)
12:06:22.444 at require (internal/modules/cjs/helpers.js:16:16)
12:06:22.449 at Object.<anonymous> (C:\Users\28267\Desktop\LT-uniapp\liangtian-uni-app\node_modules.store\@dcloudio+uni-cli-shared@3.0.0-4010520240507001\node_modules\@dcloudio\uni-cli-shared\dist\vite\utils\plugin.js:5:17)
12:06:22.452 at Module._compile (internal/modules/cjs/loader.js:759:30)
12:06:22.457 at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
12:06:22.462 at Module.load (internal/modules/cjs/loader.js:628:32)

bug描述:

12:06:20.494 项目 'liangtian-uni-app' 开始编译...
12:06:22.398 C:\Users\28267\Desktop\LT-uniapp\liangtian-uni-app\node_modules.store\@dcloudio+uni-cli-shared@3.0.0-4010520240507001\node_modules\@dcloudio\uni-cli-shared\dist\vite\plugins\vitejs\plugins\asset.js:87
12:06:22.402 const url = await fileToUrl(id, config, options?.isAndroidX
12:06:22.415 ^
12:06:22.418 SyntaxError: Unexpected token .
12:06:22.425 at Module._compile (internal/modules/cjs/loader.js:703:23)
12:06:22.427 at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
12:06:22.433 at Module.load (internal/modules/cjs/loader.js:628:32)
12:06:22.436 at Function.Module._load (internal/modules/cjs/loader.js:555:12)
12:06:22.441 at Module.require (internal/modules/cjs/loader.js:666:19)
12:06:22.444 at require (internal/modules/cjs/helpers.js:16:16)
12:06:22.449 at Object.<anonymous> (C:\Users\28267\Desktop\LT-uniapp\liangtian-uni-app\node_modules.store\@dcloudio+uni-cli-shared@3.0.0-4010520240507001\node_modules\@dcloudio\uni-cli-shared\dist\vite\utils\plugin.js:5:17)
12:06:22.452 at Module._compile (internal/modules/cjs/loader.js:759:30)
12:06:22.457 at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
12:06:22.462 at Module.load (internal/modules/cjs/loader.js:628:32)

2024-08-14 12:11 负责人:无 分享
已邀请:
BFC

BFC

你好,相关帖子,升级一下你的node版本试一下

  • h***@163.com (作者)

    ok了,改其他项目时node版本没切回来

    2024-08-26 14:16

要回复问题请先登录注册