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开发的小程序,之后转换成H5,发现了几个问题 #5165

Closed
darkfiredarkhalo opened this issue Dec 24, 2019 · 8 comments
Closed
Assignees

Comments

@darkfiredarkhalo
Copy link

darkfiredarkhalo commented Dec 24, 2019

问题描述

  • 1, 样式和小程序出入较大,有错乱
  • 2, 报错require(...) is not a function

复现步骤

  1. 打开一个使用Taro1.3.29版开发的小程序,然后使用taro update selftaro update project升级
  2. 按照#4837修改
  3. 使用yarn dev:h5运行项目
  4. 终端显示报错信息,浏览器h5页面样式错乱

期望行为

能够正常将taro开发的小程序转换成h5,或者提供下降级taro的方法

报错信息

TypeError: require(...) is not a function
    at Object.entries.forEach (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/config/postcss.conf.js:68:45)
    at Array.forEach (<anonymous>)
    at Object.exports.getPostcssPlugins (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/config/postcss.conf.js:58:35)
    at Object.getModule (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/util/chain.js:274:37)
    at Object.default_1 [as default] (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/config/dev.conf.js:51:25)
    at Object.<anonymous> (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/index.js:60:44)
    at Generator.next (<anonymous>)
    at /Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/index.js:3:12)
    at buildDev (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/index.js:52:39)
    at Object.<anonymous> (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/index.js:125:19)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/shang/Desktop/Work/gusto_wx/node_modules/@tarojs/webpack-runner/dist/index.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)  

系统信息

Taro CLI 2.0.0-beta.10 environment info:
    System:
      OS: macOS 10.15.2
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.16.0 - /usr/local/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm

补充信息

能否提供一个简便安全的taro降级方法

@taro-bot
Copy link

taro-bot bot commented Dec 24, 2019

CC @Littly

@taro-bot
Copy link

taro-bot bot commented Dec 24, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Garfield550
Copy link
Collaborator

Garfield550 commented Dec 24, 2019

  1. 手动修改 package.json,把 2.0.0-beta.10 改成 1.3.31,然后重新 Install。
  2. 使用 npm install -g @tarojs/[email protected] 重新安装 CLI,yarn 也可以。

@darkfiredarkhalo
Copy link
Author

darkfiredarkhalo commented Dec 24, 2019

@Garfield550 使用npm i -g @tarojs/[email protected]报错,Unhandled rejection RangeError: Maximum call stack size exceededill install loadIdealTree

@darkfiredarkhalo
Copy link
Author

darkfiredarkhalo commented Dec 24, 2019

使用yarn global add @tarojs/[email protected]解决了

@darkfiredarkhalo
Copy link
Author

样式错乱是我的问题,尺寸单位用了rpx

@darkfiredarkhalo
Copy link
Author

报错的问题,降级到1.3.29之后也木有了

@xu-Aurora
Copy link

样式错乱是我的问题,尺寸单位用了rpx

跨端开始不本应该样式单位就用‘rpx’嘛?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants