uni-app 使用HBuilder打包提示'looseToNumber' is not exported by @vue+shared

7z5jn7bk  于 4个月前  发布在  uni-app
关注(0)|答案(7)|浏览(73)

问题描述

复现步骤
[复现问题的步骤]

    1. 打开HBuilder
    1. 启动云打包
    1. 等待终端信息

我的项目地址 https://github.com/hfut-soft-ware/hfut-space-app

预期结果
应该打包成功的

实际结果

[HBuilder] 18:08:26.892 项目 'hfut-space-app' 开始编译...
[HBuilder] 18:08:28.467 编译器版本:3.6.1(vue3)
[HBuilder] 18:08:28.470 正在编译中...
[HBuilder] 18:08:30.612 uni-app 有新版本发布,请执行 `npx @dcloudio/uvm alpha` 更新,更新日志详见:https://update.dcloud.net.cn/hbuilderx/changelog/3.7.1.20230210-alpha.html
[HBuilder] 18:08:30.622 vite v2.9.15 building for production...
[HBuilder] 18:08:34.800 'looseToNumber' is not exported by node_modules/.pnpm/@vue+shared@3.2.37/node_modules/@vue/shared/dist/shared.esm-bundler.js, imported by node_modules/.pnpm/@vue+runtime-core@3.2.47/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
[HBuilder] 18:08:34.800 at ../node_modules/.pnpm/@vue+runtime-core@3.2.47/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3:105
[HBuilder] 18:08:34.806   1: import { pauseTracking, resetTracking, isRef, toRaw, getCurrentScope, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
[HBuilder] 18:08:34.815   2: export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
[HBuilder] 18:08:34.822   3: import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, invokeArrayFns, isRegExp, isBuiltInDirective, capitalize, isGloballyWhitelisted, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, NO, normalizeClass, normalizeStyle } from '@vue/shared';
[HBuilder] 18:08:34.831                                                                                                               ^
[HBuilder] 18:08:34.836   4: export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
[HBuilder] 18:08:34.837 error during build:
[HBuilder] 18:08:34.843 Error: 'looseToNumber' is not exported by node_modules/.pnpm/@vue+shared@3.2.37/node_modules/@vue/shared/dist/shared.esm-bundler.js, imported by node_modules/.pnpm/@vue+runtime-core@3.2.47/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
[HBuilder] 18:08:34.849     at error (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:198:30)
[HBuilder] 18:08:34.855     at Module.error (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:12543:16)
[HBuilder] 18:08:34.856     at Module.traceVariable (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:12902:29)
[HBuilder] 18:08:34.862     at ModuleScope.findVariable (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:11554:39)
[HBuilder] 18:08:34.863     at FunctionScope.findVariable (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:6486:38)
[HBuilder] 18:08:34.869     at ChildScope.findVariable (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:6486:38)
[HBuilder] 18:08:34.876     at TrackingScope.findVariable (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:6486:38)
[HBuilder] 18:08:34.883     at BlockScope.findVariable (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:6486:38)
[HBuilder] 18:08:34.891     at TrackingScope.findVariable (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:6486:38)
[HBuilder] 18:08:34.898     at BlockScope.findVariable (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:6486:38)
[HBuilder] 18:08:34.904     at Identifier.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:7553:40)
[HBuilder] 18:08:34.905     at CallExpression.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5379:73)
[HBuilder] 18:08:34.911     at CallExpression.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:9049:15)
[HBuilder] 18:08:34.917     at AssignmentExpression.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5383:23)
[HBuilder] 18:08:34.921     at ExpressionStatement.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5383:23)
[HBuilder] 18:08:34.927     at BlockStatement.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5379:73)
[HBuilder] 18:08:34.933     at IfStatement.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5383:23)
[HBuilder] 18:08:34.937     at BlockStatement.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5379:73)
[HBuilder] 18:08:34.943     at IfStatement.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5383:23)
[HBuilder] 18:08:34.949     at BlockStatement.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5379:73)
[HBuilder] 18:08:34.957     at FunctionDeclaration.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5383:23)
[HBuilder] 18:08:34.963     at Program.bind (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:5379:73)
[HBuilder] 18:08:34.970     at Module.bindReferences (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:12539:18)
[HBuilder] 18:08:34.978     at Graph.sortModules (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:23108:20)
[HBuilder] 18:08:34.984     at Graph.build (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:22986:14)
[HBuilder] 18:08:34.990     at async D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:23680:13
[HBuilder] 18:08:34.996     at async catchUnfinishedHookActions (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:23162:20)
[HBuilder] 18:08:35.006     at async rollupInternal (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:23677:5)
[HBuilder] 18:08:35.011     at async doBuild (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\vite@2.9.15_sass@1.56.1\node_modules\vite\dist\node\chunks\dep-689425f3.js:41710:24)
[HBuilder] 18:08:35.021     at async build (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\vite@2.9.15_sass@1.56.1\node_modules\vite\dist\node\chunks\dep-689425f3.js:41552:16)
[HBuilder] 18:08:35.021     at async buildApp (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.47\node_modules\@dcloudio\vite-plugin-uni\dist\cli\build.js:94:24)
[HBuilder] 18:08:35.028     at async CAC.runBuild (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.47\node_modules\@dcloudio\vite-plugin-uni\dist\cli\action.js:80:9)
pieyvz9o

pieyvz9o1#

错误提示又变了

[HBuilder] 18:37:01.089 项目 'hfut-space-app' 开始编译...
[HBuilder] 18:37:03.242 编译器版本:3.6.1(vue3)
[HBuilder] 18:37:03.250 正在编译中...
[HBuilder] 18:37:04.884 uni-app 有新版本发布,请执行 `npx @dcloudio/uvm alpha` 更新,更新日志详见:https://update.dcloud.net.cn/hbuilderx/changelog/3.7.1.20230210-alpha.html
[HBuilder] 18:37:05.037 vite v2.9.15 building for production...
[HBuilder] 18:37:05.193 [plugin:uni:resolve-id] Cannot find module '@dcloudio\uni-app\dist\uni-app.es.js'
[HBuilder] 18:37:05.194 Require stack:
[HBuilder] 18:37:05.200 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\resolve.js
[HBuilder] 18:37:05.201 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\json\mp\jsonFile.js
[HBuilder] 18:37:05.207 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\mp\usingComponents.js
[HBuilder] 18:37:05.208 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\mp\index.js
[HBuilder] 18:37:05.210 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\index.js
[HBuilder] 18:37:05.213 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.37\node_modules\@dcloudio\vite-plugin-uni\dist\cli\utils.js
[HBuilder] 18:37:05.213 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.37\node_modules\@dcloudio\vite-plugin-uni\dist\cli\index.js
[HBuilder] 18:37:05.217 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.37\node_modules\@dcloudio\vite-plugin-uni\bin\uni.js
[HBuilder] 18:37:05.221 error during build:
[HBuilder] 18:37:05.222 Error: Cannot find module '@dcloudio\uni-app\dist\uni-app.es.js'
[HBuilder] 18:37:05.225 Require stack:
[HBuilder] 18:37:05.227 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\resolve.js
[HBuilder] 18:37:05.229 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\json\mp\jsonFile.js
[HBuilder] 18:37:05.232 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\mp\usingComponents.js
[HBuilder] 18:37:05.235 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\mp\index.js
[HBuilder] 18:37:05.237 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\index.js
[HBuilder] 18:37:05.242 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.37\node_modules\@dcloudio\vite-plugin-uni\dist\cli\utils.js
[HBuilder] 18:37:05.244 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.37\node_modules\@dcloudio\vite-plugin-uni\dist\cli\index.js
[HBuilder] 18:37:05.244 - D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.37\node_modules\@dcloudio\vite-plugin-uni\bin\uni.js
[HBuilder] 18:37:05.247     at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
[HBuilder] 18:37:05.248     at Module._resolveFilename (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\module-alias@2.2.2\node_modules\module-alias\index.js:49:29)
[HBuilder] 18:37:05.253     at Function.resolve (node:internal/modules/cjs/helpers:108:19)
[HBuilder] 18:37:05.253     at resolveBuiltIn (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+uni-cli-shared@3.0.0-alpha-3060120220907002_vue@3.2.37\node_modules\@dcloudio\uni-cli-shared\dist\resolve.js:87:20)
[HBuilder] 18:37:05.258     at Object.resolveId (D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\@dcloudio+vite-plugin-uni@3.0.0-alpha-3060120220907002_vite@2.9.15+vue@3.2.37\node_modules\@dcloudio\vite-plugin-uni\dist\configResolved\plugins\resolveId.js:34:80)
[HBuilder] 18:37:05.262     at D:\Dev\hfut\hfut-space-app\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:22826:37
[HBuilder] 18:37:05.265     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
kmb7vmvb

kmb7vmvb2#

我也遇到相同的问题了

vfwfrxfs

vfwfrxfs3#

使用的是 HX 3.6.1 ?之前使用云打包功能是正常的,然后突然出现这个情况了?在 本地运行/制作本地打包资源 等是否正常?

tp5buhyn

tp5buhyn4#

使用的是 HX 3.6.1 ?之前使用云打包功能是正常的,然后突然出现这个情况了?在 本地运行/制作本地打包资源 等是否正常?

3.6.18,之前没试过打包,这次就是想尝试一下app是否能打包成功

f5emj3cl

f5emj3cl5#

从你给的信息中可以看到使用的是 HX 3.6.1 版本打包的,是 cli 项目?升级一下依赖再试试,使用 yarn 安装

wnavrhmk

wnavrhmk6#

升级到最新的3.0.0-alpha-3080520230612002,也出现了这个问题:

Uncaught SyntaxError: The requested module '/node_modules/@vue/shared/dist/shared.esm-bundler.js' does not provide an export named 'looseToNumber' (at vue.runtime.esm.js:1:204)

alen0pnh

alen0pnh7#

升级到最新的3.0.0-alpha-3080520230612002,也出现了这个问题:

Uncaught SyntaxError: The requested module '/node_modules/@vue/shared/dist/shared.esm-bundler.js' does not provide an export named 'looseToNumber' (at vue.runtime.esm.js:1:204)

vue 版本是多少?

相关问题