uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

自定义条件编译平台报错: "getEscapedCssVarName" is not exported by "node_modules/@vue/shared/dist/shared.esm-bundler.js"

Open zcgzxg opened this issue 6 months ago • 1 comments

发行方式

小程序

具体平台

微信小程序8.0.5

开发环境

Windows

项目创建方式

CLI命令行

依赖版本

"dependencies": {
    "@dcloudio/uni-app": "3.0.0-4050720250324001",
    "@dcloudio/uni-app-plus": "3.0.0-4050720250324001",
    "@dcloudio/uni-components": "3.0.0-4050720250324001",
    "@dcloudio/uni-mp-qq": "3.0.0-4050720250324001",
    "@dcloudio/uni-mp-weixin": "3.0.0-4050720250324001",
    "vue": "^3.4.21",
    "vue-i18n": "^9.1.9"
  },
  "devDependencies": {
    "@dcloudio/types": "^3.4.8",
    "@dcloudio/uni-automator": "3.0.0-4050720250324001",
    "@dcloudio/uni-cli-shared": "3.0.0-4050720250324001",
    "@dcloudio/uni-stacktracey": "3.0.0-4050720250324001",
    "@dcloudio/vite-plugin-uni": "3.0.0-4050720250324001",
    "@vue/runtime-core": "^3.4.21",
    "@vue/tsconfig": "^0.1.3",
    "rollup-plugin-visualizer": "^5.14.0",
    "typescript": "^4.9.4",
    "vite": "5.2.8",
    "vue-tsc": "^1.0.24"
  },

问题描述

我在package.json中添加了以下uni-app配置

 "uni-app": {
    "scripts": {
      "mp-pro": {
        "title": "微信小程序pro版",
        "browser": false,
        "env": {
          "UNI_PLATFORM": "mp-wexin",
          "MP_PRO": "TRUE"
        },
        "define": {
          "WX_PRO": true
        }
      },
      "mp-bak": {
        "title": "微信小程序备用版",
        "env": {
          "UNI_PLATFORM": "mp-wexin",
          "MP_BAK": "TRUE"
        },
        "define": {
          "WX_BAK": true
        }
      }
    }
  },

重现步骤

示例项目 https://github.com/zcgzxg/my-uniapp

期望行为

自定义条件编译平台可以正常编译

实际行为

编译时报以下错误

$ uni -p wx-pro
请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。
正在编译中...
node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js (8:293): "getEscapedCssVarName" is not exported by "node_modules/@vue/shared/dist/shared.esm-bundler.js", imported by "node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js".
at ../node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:8:293
  6: import { pauseTracking, resetTracking, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, shallowReadArray, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as c...
  7: export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, sha...
  8: import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscaped...
                                                                                                                                                   
                                                                                                                                                   
    ^
  9: export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';

截图或录屏

No response

zcgzxg avatar Apr 28 '25 14:04 zcgzxg