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

升级到2.2.14后无法得到正确的小程序build #7674

Closed
Eric-Guo opened this issue Sep 18, 2020 · 7 comments
Closed

升级到2.2.14后无法得到正确的小程序build #7674

Eric-Guo opened this issue Sep 18, 2020 · 7 comments
Assignees
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x

Comments

@Eric-Guo
Copy link

相关平台

微信小程序

小程序基础库: 2.12.2
使用框架: React

复现步骤

npm -g install @tarojs/[email protected]
cd my_wechat_app_folder
npm run build:weapp

期望结果

可以正确build

实际结果

报错,找不到组件

环境信息

👽 Taro v2.2.14


  Taro CLI 2.2.14 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 5.0.18 - /usr/local/bin/bash
    Binaries:
      Node: 14.11.0 - /usr/local/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.8 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 2.2.14 => 2.2.14 
      @tarojs/components-qa: 2.2.14 => 2.2.14 
      @tarojs/mini-runner: 2.2.14 => 2.2.14 
      @tarojs/plugin-babel: 2.2.14 => 2.2.14 
      @tarojs/plugin-sass: 2.2.14 => 2.2.14 
      @tarojs/plugin-terser: 2.2.14 => 2.2.14 
      @tarojs/redux: 2.2.14 => 2.2.14 
      @tarojs/redux-h5: 2.2.14 => 2.2.14 
      @tarojs/router: 2.2.14 => 2.2.14 
      @tarojs/taro: 2.2.14 => 2.2.14 
      @tarojs/taro-alipay: 2.2.14 => 2.2.14 
      @tarojs/taro-h5: 2.2.14 => 2.2.14 
      @tarojs/taro-qq: 2.2.14 => 2.2.14 
      @tarojs/taro-quickapp: 2.2.14 => 2.2.14 
      @tarojs/taro-rn: 2.2.14 => 2.2.14 
      @tarojs/taro-swan: 2.2.14 => 2.2.14 
      @tarojs/taro-tt: 2.2.14 => 2.2.14 
      @tarojs/taro-weapp: 2.2.14 => 2.2.14 
      @tarojs/webpack-runner: 2.2.14 => 2.2.14 
      eslint-config-taro: 2.2.14 => 2.2.14 
      eslint-plugin-taro: 2.2.14 => 2.2.14 
      nerv-devtools: ^1.5.7 => 1.5.7 
      nervjs: ^1.5.7 => 1.5.7 
      stylelint-config-taro-rn: 2.2.14 => 2.2.14 
      stylelint-taro-rn: 2.2.14 => 2.2.14 
      taro-ui: ^2.3.4 => 2.3.4 
    npmGlobalPackages:
      typescript: 3.9.7

补充信息

3453ca7#diff-1607241144e4efce8a5cbc34fa7786f2L441

就是这个PR #7360 改动的问题。

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x labels Sep 18, 2020
@Eric-Guo
Copy link
Author

安装完2.2.14后,直接改动/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/helper/dist/utils.js 文件到以前的样子就正常了。

@zlyyyy
Copy link

zlyyyy commented Sep 21, 2020

好巧。。我也遇到了

@ZakaryCode
Copy link
Contributor

未能复现该问题,方便提供一个可复现的项目么

@ydiego
Copy link

ydiego commented Sep 23, 2020

未能复现该问题,方便提供一个可复现的项目么

babel: {
  presets: [
      ['env', { modules: false}]   
  ],
}

项目中babel配置如上就能复现

修改成如下配置就可以正常build

babel: {
  presets: [
      'env'
  ],
}

@ZakaryCode
Copy link
Contributor

未能复现该问题,方便提供一个可复现的项目么

babel: {
  presets: [
      ['env', { modules: false}]   
  ],
}

项目中babel配置如上就能复现

修改成如下配置就可以正常build

babel: {
  presets: [
      'env'
  ],
}

按照如上方法并不能复现该问题

@ydiego
Copy link

ydiego commented Sep 23, 2020

未能复现该问题,方便提供一个可复现的项目么

babel: {
  presets: [
      ['env', { modules: false}]   
  ],
}

项目中babel配置如上就能复现
修改成如下配置就可以正常build

babel: {
  presets: [
      'env'
  ],
}

按照如上方法并不能复现该问题

我这边遇到问题的原因是项目中引用了taro-ui ,build之后报了无法找到taro-UI相关组件的错误,根据2.2.13修复的babel-preset-env配置问题的提交记录,验证之后才有的以上的解决方法 taro-ui中也有相关的issue1052

@Eric-Guo
Copy link
Author

config/index.js 改成如下可以工作。

    presets: [
-      ['env', { modules: false }]
+      ['env']
    ],

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-2 Version - 2.x
Projects
None yet
Development

No branches or pull requests

5 participants