NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.34k stars 4.77k forks source link

Taro CLI 3.6.0-beta.2启动报错 #13182

Closed zzq0324 closed 1 year ago

zzq0324 commented 1 year ago

相关平台

微信小程序

小程序基础库: 未知 使用框架: Vue 3

复现步骤

使用3.6.0-beta.2版本后,通过taro init一个项目,选择vue3以及nutui之后,执行启动脚本会报错,报错信息如下:

/Users/zhengzhq/workspace/incubation-idea/fe-bill/node_modules/.pnpm/@tarojs/plugin-html@3.6.0-beta.2/dist/index.js:123
        traverse(ast, {
        ^

TypeError: traverse is not a function
    at patchMappingElements (/Users/zhengzhq/workspace/incubation-idea/fe-bill/node_modules/.pnpm/@tarojs/plugin-html@3.6.0-beta.2/src/index.ts:123:5)
    at index (/Users/zhengzhq/workspace/incubation-idea/fe-bill/node_modules/.pnpm/@tarojs/plugin-html@3.6.0-beta.2/src/index.ts:30:3)
    at Kernel.initPlugin (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/src/Kernel.ts:157:12)
    at Kernel.resolvePlugins (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/src/Kernel.ts:130:12)
    at Kernel.initPresetsAndPlugins (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/src/Kernel.ts:115:10)
    at Kernel.<anonymous> (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/src/Kernel.ts:312:10)
    at Generator.next (<anonymous>)
    at /opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/dist/Kernel.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/dist/Kernel.js:4:12)

期望结果

能够正常启动

实际结果

启动报错

环境信息

通过taro info也无法执行,会报错,如下:

 ➜  fe-bill git:(main) ✗ taro info
👽 Taro v3.6.0-beta.2

/Users/zhengzhq/workspace/incubation-idea/fe-bill/node_modules/.pnpm/@tarojs/plugin-html@3.6.0-beta.2/dist/index.js:123
        traverse(ast, {
        ^

TypeError: traverse is not a function
    at patchMappingElements (/Users/zhengzhq/workspace/incubation-idea/fe-bill/node_modules/.pnpm/@tarojs/plugin-html@3.6.0-beta.2/src/index.ts:123:5)
    at index (/Users/zhengzhq/workspace/incubation-idea/fe-bill/node_modules/.pnpm/@tarojs/plugin-html@3.6.0-beta.2/src/index.ts:30:3)
    at Kernel.initPlugin (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/src/Kernel.ts:157:12)
    at Kernel.resolvePlugins (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/src/Kernel.ts:130:12)
    at Kernel.initPresetsAndPlugins (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/src/Kernel.ts:115:10)
    at Kernel.<anonymous> (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/src/Kernel.ts:312:10)
    at Generator.next (<anonymous>)
    at /opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/dist/Kernel.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/opt/homebrew/lib/node_modules/@tarojs/cli/node_modules/.pnpm/@tarojs/service@3.6.0-beta.2/dist/Kernel.js:4:12)

Node.js v17.8.0
ZakaryCode commented 1 year ago

rollup 升级到 3 后,部分差异导致的问题