yzs
yzs
  • 发布:2023-01-13 10:44
  • 更新:2023-01-13 15:18
  • 阅读:413

【报Bug】支付宝小程序打包后无法运行

分类:HBuilderX

产品分类: HbuilderX

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 企业版 G

HBuilderX版本号: 3.6.17

操作步骤:

预期结果:

实际结果:

bug描述:

vue2版本打包支付宝小程序运行报错
在前两周还未出现此问题,同一套代码 这周就运行不了了

d:\project\H5\wap3\dist\dev\mp-alipay\common\vendor.js: Invalid regular expression flag (11895:28)
Please set enableNodeModuleBabelTransform to true or add "d:/project/H5/wap3/dist/dev/mp-alipay/common/vendor.js" to node_modules_es6_whitelist in mini.project.json for node_modules babel transform

只能修改打包完的代码
把 common/vendor.js 中的 const styleCommentRE = /\/*.?\//gs; 修改为 const styleCommentRE = /./;
才能正常运行
目前看最新版更新日志说vue3修复了 但是用vue2还是有这个问题

2023-01-13 10:44 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

确认是 Vue2 的项目吗?这个问题是合并 Vue3 官方仓库代码时带进来的,理论上 Vue2 项目不受影响。

如果你是 CLI 创建的 Vue3 项目,参考文档更新一下依赖。

  • yzs (作者)

    确认是vue2的项目,这个上半年创建的项目了,外面根据官网说明套了一层cli,这个不止我一个人有这个问题,我贴的相关链接你们发的版本号评论那里下面我看也有好几个人这样

    2023-01-13 13:37

  • DCloud_UNI_GSQ

    回复 yzs: npm run info 打印一下信息

    2023-01-13 14:18

  • yzs (作者)

    回复 DCloud_UNI_GSQ: uni-app v3.6.10

    uni-app cli v2.0.1-alpha-36920221121001


    Environment Info:


    System:

    OS: Windows 10

    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz

    Binaries:

    Node: 16.17.1 - C:\Program Files\nodejs\node.EXE

    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD

    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD

    Browsers:

    Edge: Not Found

    npmPackages:

    @dcloudio/types: => 3.2.7

    @dcloudio/uni-app-plus: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-app-plus-nvue: 0.0.1

    @dcloudio/uni-app-plus-nvue-v8: 0.0.1

    @dcloudio/uni-automator: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-cli-i18n: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-cli-shared: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-h5: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-helper-json:
    => 1.0.13

    @dcloudio/uni-i18n: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-migration: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-360: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-alipay: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-baidu: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-jd: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-kuaishou: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-lark: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-qq: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-toutiao: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-vue: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-weixin: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-mp-xhs: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-quickapp-native: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-quickapp-webview: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-stat: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/uni-template-compiler: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/vue-cli-plugin-hbuilderx: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/vue-cli-plugin-uni: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/vue-cli-plugin-uni-optimize: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/webpack-uni-mp-loader: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @dcloudio/webpack-uni-nvue-loader: 0.0.1

    @dcloudio/webpack-uni-pages-loader: ^2.0.1-34720220422002 => 2.0.1-alpha-36920221121001

    @hap-toolkit/dsl-vue: 0.6.13

    @vue/babel-helper-vue-jsx-merge-props: 1.4.0

    @vue/babel-helper-vue-transform-on: 1.0.2

    @vue/babel-plugin-jsx: 1.1.1

    @vue/babel-plugin-transform-vue-jsx: 1.4.0

    @vue/babel-preset-app: 4.5.19

    @vue/babel-preset-jsx: 1.4.0

    @vue/babel-sugar-composition-api-inject-h: 1.4.0

    @vue/babel-sugar-composition-api-render-instance: 1.4.0

    @vue/babel-sugar-functional-vue: 1.4.0

    @vue/babel-sugar-inject-h: 1.4.0

    @vue/babel-sugar-v-model: 1.4.0

    @vue/babel-sugar-v-on: 1.4.0

    @vue/cli-overlay: 4.5.19

    @vue/cli-plugin-babel: ~4.5.15 => 4.5.19

    @vue/cli-plugin-router: 4.5.19

    @vue/cli-plugin-vuex: 4.5.19

    @vue/cli-service: ~4.5.15 => 4.5.19

    @vue/cli-shared-utils: 4.5.19

    @vue/compiler-sfc: 2.7.14

    @vue/component-compiler-utils: 3.3.0 (3.3.0)

    @vue/composition-api: 1.7.0

    @vue/devtools-api: 6.0.0-beta.15

    @vue/preload-webpack-plugin: 1.1.2

    @vue/shared: ^3.0.0 => 3.2.45

    @vue/web-component-wrapper: 1.3.0

    babel-helper-vue-jsx-merge-props: 2.0.3

    mpvue-page-factory: 1.0.1

    mpvue-template-compiler: 1.0.13

    uni-h5-vue: 2.6.10

    uni-mp-vue: 2.6.10

    vue: ^2.6.11 => 2.7.14

    vue-hot-reload-api: 2.3.4

    vue-loader: 15.10.1 (16.8.3, 15.10.1)

    vue-matomo: 4.2.0

    vue-router: 3.0.1

    vue-style-loader: 4.1.3 (4.1.3)

    vue-template-compiler: ^2.6.11 => 2.7.14 (2.7.14)

    vue-template-es2015-compiler: 1.9.1

    vue3: 1.0.0

    vuex: ^3.2.0 => 3.6.2 (3.6.2)

    npmGlobalPackages:

    @vue/cli: Not Found

    2023-01-13 14:28

  • DCloud_UNI_GSQ

    回复 yzs: 执行 npx @dcloudio/uvm 更新一下依赖再试试,如果仍然有问题把编译后的vendor.js传上来我看下。

    2023-01-13 15:02

  • yzs (作者)

    回复 DCloud_UNI_GSQ: 更新试了下 还是不行,我把vendor.js放在下面的回复里了

    2023-01-13 15:19

  • DCloud_UNI_GSQ

    回复 yzs: 目前分析是由于使用了 vue2.7 的编译器,将 vue2.7 中新增的 bug 带进来了,可以调整 package.json 然后重新安装依赖

    2023-01-13 18:15

  • DCloud_UNI_GSQ

    "vue-template-compiler": ">= 2.6.14 < 2.7"

    2023-01-13 18:15

  • DCloud_UNI_GSQ

    "vue": ">= 2.6.14 < 2.7",

    2023-01-13 18:16

  • yzs (作者)

    回复 DCloud_UNI_GSQ: 好的 我试下 谢谢

    2023-01-13 18:25

yzs

yzs (作者)

编译后的vendor.js

要回复问题请先登录注册