Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【taro 3.5.5】 taro convet命令将微信小程序转换为taro项目报错 #14982

Closed
zhhwdev opened this issue Dec 13, 2023 · 0 comments
Closed
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@zhhwdev
Copy link

zhhwdev commented Dec 13, 2023

相关平台

微信小程序

复现仓库

https://github.com/yandingzhou/Copy_of_Zhihu.git
小程序基础库: 3.3.5
使用框架: React

复现步骤

在微信小程序目录下,执行taro convert报错

期望结果

转换正常

实际结果

生成 样式文件 taroConvert/src/pages/answer/answer.scss
生成 样式文件 taroConvert/src/pages/question/question.scss
"/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/templates/default/package.json.tmpl":105
; if (compiler === 'webpack4') {
^

ReferenceError: /Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/templates/default/package.json.tmpl:67
65| "@tarojs/cli": "<%= version %>",
66| "@types/webpack-env": "^1.13.6",<% if (['react', 'preact'].includes(framework)) {%>

67| "@types/react": "^18.0.0",<%}%><% if (compiler === 'webpack4') {%>
68| "@tarojs/mini-runner": "<%= version %>",
69| "@tarojs/webpack-runner": "<%= version %>",
70| "webpack": "4.46.0",<%} else if (compiler === 'webpack5') {%>

compiler is not defined
at eval ("/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/templates/default/package.json.tmpl":105:8)
at package.json (/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:703:17)
at Object.exports.render (/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:425:37)
at render (/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:13:18)
at process (/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:35:16)
at applyProcessingFunc (/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/node_modules/mem-fs-editor/lib/actions/copy.js:13:16)
at EditionInterface.exports._copySingle (/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/node_modules/mem-fs-editor/lib/actions/copy.js:65:16)
at /Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/node_modules/mem-fs-editor/lib/actions/copy.js:52:10
at Array.forEach ()
at EditionInterface.exports.copy (/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/node_modules/mem-fs-editor/lib/actions/copy.js:51:9) {
path: '/Users/zheng.huawei/.nvm/versions/node/v16.20.1/lib/node_modules/@tarojs/cli/templates/default/package.json.tmpl'
}

环境信息

👽 Taro v3.5.5


  Taro CLI 3.5.5 environment info:
    System:
      OS: macOS 14.1.2
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 16.20.1 - ~/.nvm/versions/node/v16.20.1/bin/node
      Yarn: 1.22.19 - /opt/homebrew/bin/yarn
      npm: 9.8.1 - ~/.nvm/versions/node/v16.20.1/bin/npm

补充信息

因为我是想微信小程序转换为RN代码,并且本地rn代码是0.68.7, 所以选择了3.5.5版本。
希望后续版本中,对于rn的支撑减少对expo的依赖,这个对于我们集成照成了不必要的依赖

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Dec 13, 2023
@zhhwdev zhhwdev closed this as completed Dec 15, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Mini Program Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

1 participant