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 1.3 beta 版本测试通告(当前版本:1.3.0-beta.8) #2947

Closed
luckyadam opened this issue May 5, 2019 · 167 comments
Closed

Taro 1.3 beta 版本测试通告(当前版本:1.3.0-beta.8) #2947

luckyadam opened this issue May 5, 2019 · 167 comments

Comments

@luckyadam
Copy link
Member

luckyadam commented May 5, 2019

大家好~
在 Taro 项目组以及社区共同努力下,历时半年左右的开发时间,累计超过 1400 余次 Commit 的 Taro v1.3 beta 版本终于横空出世了!

正所谓「宝剑锋从磨砺出,梅花香自苦寒来」,这是 Taro 历经考验最多的一个版本,是 Taro 遇到问题最多的一个版本,但也是 Taro 自诞生以来,包含特性最为丰富的一个版本。曾经,1.3 版本经历过数次延期,遭受过是否难产的质疑,但横跨半年的开发时间,我们只是一直在不断打磨,不断创新,而不是在虚延岁月。我们可能会迟到,但永远不会缺席!

版本特性

Taro v1.3 版本将为大家带来以下重要的特性:

支持快应用开发

从 1.3 开始,Taro 将正式开始支持 快应用 开发,目前已经在 华为/小米 两个支持快应用的手机上进行测试,支持的快应用平台版本为 1010+

目前已经适配的组件与 API 情况如下:

  • 组件库支持:checkbox/radio/image/input/label/progress/slider/switch/view/text/rich-text
  • API 支持:网络请求、路由 API、分享、界面弹窗、震动、本地存储、部分设备等相关 API

具体使用方式请参考 https://nervjs.github.io/taro/docs/quick-app.html

需要注意的是,在 beta 版本中,由于快应用相关组件与 API 支持还不完善,所以建议不要直接使用 beta 版本开发直接开发快应用。

支持 QQ 轻应用开发

从 1.3 开始,Taro 将正式开始支持 QQ 轻应用 开发。

全面支持 JSX 语法和 React Hooks

从 1.3 开始 Taro 支持了更多的 JSX 写法,包括但不限于,支持函数式组件、render 之外书写 JSX 等等,同时,更让人惊喜的是,新的版本带来了 React Hooks 的支持,大家可以通过如下两个例子进行学习使用:

V2EX: https://github.com/NervJS/taro-v2ex-hooks

TodoMVC: https://github.com/NervJS/taro-todomvc-hooks

大幅提高 H5 性能和可用性

在 1.3 版本中,H5 的打包大小得到了进一步优化,同时 H5 端的 API/组件 数量和质量也得到了大幅地增长,让 H5 的转换更令人放心。

同时,H5 对小程序的页面函数钩子如,onPageScroll/onPullDownRefresh/onReachBottom 等,也进行了同步支持,开发者不再需要自己去写平台区分代码来处理了。

Taro doctor 代码诊断

Taro Doctor 就像一个医生一样,可以诊断项目的依赖、设置、结构,以及代码的规范是否存在问题,并尝试给出解决方案
image

多端同步调试

从 1.3 版本开始,项目编译后的结果不再直接放在 dist 目录下,而是会在 dist 目录下创建一个与编译的目标平台名同名的目录,并将结果放在这个目录下,例如编译到微信小程序,最终结果是在 dist/weapp 目录下,这样做的好处是,各个平台使用独立的目录互不影响,从而达到多端同步调试的目的。

1.3.5-beta.5 开始恢复之前的编译操作,文件会直接编译到 config 中配置的 outputRoot 目录下,如果需要多端同时调试,可以修改配置为

outputRoot: `dist/${process.env.TARO_ENV}`

组件传参(props)系统重构

在 1.3 版本中,我们针对小程序端的 props 系统进行了重构,已经不再需要借助原生小程序的 props 来进行组件属性传递,这带来了以下几点好处:

  • props 传递函数可以获取返回值,且函数名不再需要强制使用 on 开头
  • 自定义组件支持 spread properties
  • 各小程序组件生命周期执行获得统一,componentWillReceiveProps 生命周期表现一致

命令行工具(CLI) 重构

在 1.3 版本中,Taro CLI 使用 TypeScript 进行了彻底重构,为今后的插件化扩展,打下坚实基础,同时提供了 Node API 的方式进行调用,方便可持续集成系统进行集成使用。

RN 端抛弃 Expo

众所周知,Expo 并不适用于国内生态环境,在 1.3 版本中,RN 端不再继续使用 Expo,而提供了自己的 SDK 与原生的壳子,方便用户进行扩展。

支持开发小程序插件

从 1.3 版本开始,Taro 支持直接开发微信与支付宝小程序插件,可以从这里获得更多内容 https://nervjs.github.io/taro/docs/miniprogram-plugin.html

支持小程序云开发

Taro 同时加入对了小程序云开发的支持,为小程序云开发提供了初始化模板,并且将小程序云相关的 API 进行了封装,方便开发者进行使用,可以从这里获得更多内容 https://nervjs.github.io/taro/docs/wxcloud.html

以上就是 Taro 1.3 给广大开发者带来的优秀特性,目前 1.3 处于 beta 阶段,欢迎大家进行试用并提供宝贵意见,让我们一起将 Taro 变得更加好用。

如何升级

升级 Taro CLI

直接安装 beta 版本的 CLI

$ npm i -g @tarojs/cli

升级本地依赖

将 taro 相关的依赖版本号统一修改成 1.3.0-beta.8,然后删掉 node_modules,重新安装依赖即可。

1.3 的任何问题,请在本 issue 下进行回复,我们会第一时间跟进处理。

@taro-bot
Copy link

taro-bot bot commented May 5, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@SmallRuralDog
Copy link
Contributor

支持!!!

@yxyufo110
Copy link

666

@qiliangya
Copy link

目前h5,微信 支付宝小程序 都靠 taro, 加油!

@sun2483968
Copy link

Nice!!!

@littlesupermanio
Copy link

资词

@bailicangdu
Copy link

@wangxu20133
Copy link

顶!d=====( ̄▽ ̄*)b

@HazySoda
Copy link

HazySoda commented May 5, 2019

支持 Taro

@shuwenjunn
Copy link

unbelievable

@lzane
Copy link

lzane commented May 5, 2019

关注,支持!

@caoliren
Copy link

caoliren commented May 5, 2019

支持!

@zpzxgcr
Copy link

zpzxgcr commented May 5, 2019

Taro 果然宇宙最强奥特曼啊 哈哈~

@geekape
Copy link

geekape commented May 5, 2019

支持支持,学好React,上手taro

@anthhub
Copy link

anthhub commented May 5, 2019

顶一个

@yanghcc
Copy link

yanghcc commented May 5, 2019

赞~

@lita-jerry
Copy link
Contributor

666

@jun601011814
Copy link

强~

@DuanShuaiShuai
Copy link

666~

@aotemanzhuangui
Copy link

Good!

@uxiew
Copy link

uxiew commented May 5, 2019

👍

@tonghao12
Copy link

@ZhangZhongren
Copy link

nice

@excxapp
Copy link

excxapp commented May 5, 2019

niu

@lixiang
Copy link

lixiang commented May 5, 2019

66666

@jesse-tang-93
Copy link

大爱Taro~

@jinjinwa
Copy link

jinjinwa commented May 5, 2019

赞一个👍

@lk-chan
Copy link

lk-chan commented May 5, 2019

辛苦了

@ShaoGongBra
Copy link
Contributor

前排围观

@handycode
Copy link

升级后 会报错 vdSyncBatch 数据传输长度为 1095692 已经超过最大长度

@dawang90
Copy link

if (process.env.TARO_ENV === 'swan') {
swan.setPageInfo && swan.setPageInfo()
}
TypeError: Cannot set property 'customPageInfo' of undefined

@soqt
Copy link

soqt commented May 28, 2019

页面的config是否可以传入functional component?因为react hooks的想法是在未来取代class组件,但是如果设置config的话就必须用class组件。

@likun7981
Copy link

同问 config 在 functional component 怎么传入

@sycreece
Copy link

sycreece commented May 31, 2019

Taro CLI 1.3.0-beta.5 environment info:
System:
OS: macOS 10.14.5
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.0 - ~.tnvm/versions/alinode/v4.7.0/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.4.1 - ~.tnvm/versions/alinode/v4.7.0/bin/npm
npmPackages:
@tarojs/async-await: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/components: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/plugin-babel: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/plugin-csso: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/plugin-sass: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/plugin-uglifyjs: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/redux: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/redux-h5: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/router: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-alipay: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-h5: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-swan: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-tt: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-weapp: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/webpack-runner: 1.3.0-beta.5 => 1.3.0-beta.5
eslint-config-taro: 1.3.0-beta.5 => 1.3.0-beta.5
eslint-plugin-taro: 1.3.0-beta.5 => 1.3.0-beta.5
nervjs: ^1.4.0-beta.5 => 1.4.0-beta.5
npmGlobalPackages:
typescript: 3.3.4000

声明:以下问题在1.2.x上运行正常;

问题:
1、不兼容1.2.x版本写的逻辑;
2、子组件不进入componentDidShow;
3、this.props 报undefined;
4、wx音频控制抛错,如下图;
image

@BrookShuihuaLee
Copy link

想试一下1.3.0-beta.5的Context,但是报_index2.default.createContext is not a function,应该是Taro.createContext不存在导致的。请问这个是怎么回事。。。

@yuche
Copy link
Contributor

yuche commented May 31, 2019

想试一下1.3.0-beta.5的Context,但是报_index2.default.createContext is not a function,应该是Taro.createContext不存在导致的。请问这个是怎么回事。。。

beta5 只有微信小程序和 h5 有这个 API,h5 你要更新 nervjs 的依赖

@BrookShuihuaLee
Copy link

想试一下1.3.0-beta.5的Context,但是报_index2.default.createContext is not a function,应该是Taro.createContext不存在导致的。请问这个是怎么回事。。。

beta5 只有微信小程序和 h5 有这个 API,h5 你要更新 nervjs 的依赖

我现在编译的是头条小程序,应该也能开启吧?需要更新什么吗?


  "dependencies": {
    "@bdeefe/api-design": "^0.2.15",
    "@bdeefe/api-design-loading": "0.0.2",
    "@bdeefe/api-design-login": "0.0.4",
    "@bdeefe/api-design-request-micro": "^0.1.5",
    "@tarojs/async-await": "1.3.0-beta.5",
    "@tarojs/components": "1.3.0-beta.5",
    "@tarojs/mobx": "1.3.0-beta.5",
    "@tarojs/mobx-h5": "1.3.0-beta.5",
    "@tarojs/mobx-rn": "1.3.0-beta.5",
    "@tarojs/rn-runner": "1.3.0-beta.5",
    "@tarojs/router": "1.3.0-beta.5",
    "@tarojs/taro": "1.3.0-beta.5",
    "@tarojs/taro-alipay": "1.3.0-beta.5",
    "@tarojs/taro-h5": "1.3.0-beta.5",
    "@tarojs/taro-swan": "1.3.0-beta.5",
    "@tarojs/taro-tt": "1.3.0-beta.5",
    "@tarojs/taro-weapp": "1.3.0-beta.5",
    "@types/classnames": "^2.2.7",
    "@types/lodash": "^4.14.130",
    "classnames": "^2.2.6",
    "dayjs": "^1.8.14",
    "i18next": "^15.1.1",
    "lodash": "^4.17.11",
    "mobx": "4.8.0",
    "nerv-devtools": "^1.4.0-beta.3",
    "nervjs": "^1.4.0-beta.3"
  },
  "devDependencies": {
    "@bdeefe/eslint-config": "^1.0.8",
    "@bdeefe/stylelint-config": "^1.0.5",
    "@ies/starling-cli": "^1.0.5",
    "@tarojs/plugin-babel": "1.3.0-beta.5",
    "@tarojs/plugin-csso": "1.3.0-beta.5",
    "@tarojs/plugin-less": "1.3.0-beta.5",
    "@tarojs/plugin-uglifyjs": "1.3.0-beta.5",
    "@tarojs/webpack-runner": "1.3.0-beta.5",
    "@types/react": "16.3.14",
    "@types/webpack-env": "^1.13.6",
    "@typescript-eslint/eslint-plugin": "^1.9.0",
    "@typescript-eslint/parser": "^1.6.0",
    "babel-eslint": "^8.2.3",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-jsx-stylesheet": "^0.6.5",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "eslint": "^5.16.0",
    "eslint-config-prettier": "^4.3.0",
    "eslint-config-taro": "1.3.0-beta.5",
    "eslint-plugin-import": "^2.12.0",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-react": "^7.8.2",
    "eslint-plugin-taro": "1.3.0-beta.5",
    "eslint-plugin-typescript-sort-keys": "^0.2.0",
    "fs-extra": "^8.0.1",
    "husky": "^2.3.0",
    "json-stable-stringify": "^1.0.1",
    "node-fetch": "^2.6.0",
    "prettier": "^1.17.1",
    "stylelint": "^9.3.0",
    "stylelint-config-prettier": "^5.2.0",
    "stylelint-config-taro-rn": "1.3.0-beta.3",
    "stylelint-taro-rn": "1.3.0-beta.3",
    "typescript": "^3.0.1"
  }

@yuche
Copy link
Contributor

yuche commented May 31, 2019

想试一下1.3.0-beta.5的Context,但是报_index2.default.createContext is not a function,应该是Taro.createContext不存在导致的。请问这个是怎么回事。。。

beta5 只有微信小程序和 h5 有这个 API,h5 你要更新 nervjs 的依赖

我现在编译的是头条小程序,应该也能开启吧?需要更新什么吗?


  "dependencies": {
    "@bdeefe/api-design": "^0.2.15",
    "@bdeefe/api-design-loading": "0.0.2",
    "@bdeefe/api-design-login": "0.0.4",
    "@bdeefe/api-design-request-micro": "^0.1.5",
    "@tarojs/async-await": "1.3.0-beta.5",
    "@tarojs/components": "1.3.0-beta.5",
    "@tarojs/mobx": "1.3.0-beta.5",
    "@tarojs/mobx-h5": "1.3.0-beta.5",
    "@tarojs/mobx-rn": "1.3.0-beta.5",
    "@tarojs/rn-runner": "1.3.0-beta.5",
    "@tarojs/router": "1.3.0-beta.5",
    "@tarojs/taro": "1.3.0-beta.5",
    "@tarojs/taro-alipay": "1.3.0-beta.5",
    "@tarojs/taro-h5": "1.3.0-beta.5",
    "@tarojs/taro-swan": "1.3.0-beta.5",
    "@tarojs/taro-tt": "1.3.0-beta.5",
    "@tarojs/taro-weapp": "1.3.0-beta.5",
    "@types/classnames": "^2.2.7",
    "@types/lodash": "^4.14.130",
    "classnames": "^2.2.6",
    "dayjs": "^1.8.14",
    "i18next": "^15.1.1",
    "lodash": "^4.17.11",
    "mobx": "4.8.0",
    "nerv-devtools": "^1.4.0-beta.3",
    "nervjs": "^1.4.0-beta.3"
  },
  "devDependencies": {
    "@bdeefe/eslint-config": "^1.0.8",
    "@bdeefe/stylelint-config": "^1.0.5",
    "@ies/starling-cli": "^1.0.5",
    "@tarojs/plugin-babel": "1.3.0-beta.5",
    "@tarojs/plugin-csso": "1.3.0-beta.5",
    "@tarojs/plugin-less": "1.3.0-beta.5",
    "@tarojs/plugin-uglifyjs": "1.3.0-beta.5",
    "@tarojs/webpack-runner": "1.3.0-beta.5",
    "@types/react": "16.3.14",
    "@types/webpack-env": "^1.13.6",
    "@typescript-eslint/eslint-plugin": "^1.9.0",
    "@typescript-eslint/parser": "^1.6.0",
    "babel-eslint": "^8.2.3",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-jsx-stylesheet": "^0.6.5",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "eslint": "^5.16.0",
    "eslint-config-prettier": "^4.3.0",
    "eslint-config-taro": "1.3.0-beta.5",
    "eslint-plugin-import": "^2.12.0",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-react": "^7.8.2",
    "eslint-plugin-taro": "1.3.0-beta.5",
    "eslint-plugin-typescript-sort-keys": "^0.2.0",
    "fs-extra": "^8.0.1",
    "husky": "^2.3.0",
    "json-stable-stringify": "^1.0.1",
    "node-fetch": "^2.6.0",
    "prettier": "^1.17.1",
    "stylelint": "^9.3.0",
    "stylelint-config-prettier": "^5.2.0",
    "stylelint-config-taro-rn": "1.3.0-beta.3",
    "stylelint-taro-rn": "1.3.0-beta.3",
    "typescript": "^3.0.1"
  }

头条等下个版本

@d393911462
Copy link

Taro CLI 1.3.0-beta.5 environment info:
System:
OS: macOS 10.14.5
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.0 - ~.tnvm/versions/alinode/v4.7.0/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.4.1 - ~.tnvm/versions/alinode/v4.7.0/bin/npm
npmPackages:
@tarojs/async-await: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/components: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/plugin-babel: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/plugin-csso: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/plugin-sass: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/plugin-uglifyjs: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/redux: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/redux-h5: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/router: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-alipay: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-h5: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-swan: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-tt: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/taro-weapp: 1.3.0-beta.5 => 1.3.0-beta.5
@tarojs/webpack-runner: 1.3.0-beta.5 => 1.3.0-beta.5
eslint-config-taro: 1.3.0-beta.5 => 1.3.0-beta.5
eslint-plugin-taro: 1.3.0-beta.5 => 1.3.0-beta.5
nervjs: ^1.4.0-beta.5 => 1.4.0-beta.5
npmGlobalPackages:
typescript: 3.3.4000

声明:以下问题在1.2.x上运行正常;

问题:
1、不兼容1.2.x版本写的逻辑;
2、子组件不进入componentDidShow;
3、this.props 报undefined;
4、wx音频控制抛错,如下图;
image

我也遇到了上述问题

@BrookShuihuaLee
Copy link

tt小程序context是undefined。发现1.3.0-beta.6支持了context,就试了一下。但是设置contextType之后,this.context是undefined

import { Component } from "@tarojs/taro";
import { View } from "@tarojs/components";
import { ThemeContext } from "../dsf";

export default class Ddd extends Component {
  public static contextType = ThemeContext

  public render() {
    console.error('adsf', this.context)
    return (
      <View>234</View>
    )
  }
}

@luckyadam luckyadam changed the title Taro 1.3 beta 版本测试通告(当前版本:1.3.0-beta.5) Taro 1.3 beta 版本测试通告(当前版本:1.3.0-beta.6) Jun 3, 2019
@yuche
Copy link
Contributor

yuche commented Jun 3, 2019

tt小程序context是undefined。发现1.3.0-beta.6支持了context,就试了一下。但是设置contextType之后,this.context是undefined

import { Component } from "@tarojs/taro";
import { View } from "@tarojs/components";
import { ThemeContext } from "../dsf";

export default class Ddd extends Component {
  public static contextType = ThemeContext

  public render() {
    console.error('adsf', this.context)
    return (
      <View>234</View>
    )
  }
}

去提一个 issue 把

@BrookShuihuaLee
Copy link

发现1.3.0-beta.6支持了context,就试了一下。但是设置contextType之后,this.context是undefined

#3301

@luckyadam luckyadam changed the title Taro 1.3 beta 版本测试通告(当前版本:1.3.0-beta.6) Taro 1.3 beta 版本测试通告(当前版本:1.3.0-beta.8) Jun 10, 2019
@luckyadam
Copy link
Member Author

@BrookShuihuaLee 可以升级到 1.3.0-beta.8 试试

@JokerLoLgrey
Copy link

// 在css中多行文本溢出显示...
{
   display: -webkit-box;
   -webkit-line-clamp: 2;
    overflow: hidden;
    -webkit-box-orient: vertical;
}
//  但是上面的css并未如期显示在h5页面上,h5打包好后会少-webkit-box-orient: vertical;这句,目前解决方法是写在标签上

@J3n5en
Copy link

J3n5en commented Jun 10, 2019

@JokerLoLgrey

display: -webkit-box;
-webkit-line-clamp: 2;
overflow: hidden;
/*! autoprefixer: ignore next */
-webkit-box-orient: vertical;

你試試這個,我們用這個是可以的。

@PopperLi
Copy link

小程序编译不了

【版本】
`👽 Taro v1.3.0-beta.8

Taro CLI 1.3.0-beta.8 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.15.1 - D:\GHU\nodejs\node.EXE
npm: 6.4.1 - D:\GHU\nodejs\npm.CMD
【报错信息】生成 页面样式 dist/pages/goods-info/index.wxss
生成 组件配置 dist/dist/pages/cart/cart-item/index.json
生成 组件逻辑 dist/dist/pages/cart/cart-item/index.js
生成 组件模板 dist/dist/pages/cart/cart-item/index.wxml
生成 组件样式 dist/dist/pages/cart/cart-item/index.wxss
生成 页面配置 dist/pages/cart/index.json
生成 页面逻辑 dist/pages/cart/index.js
生成 页面模板 dist/pages/cart/index.wxml
生成 页面样式 dist/pages/cart/index.wxss
(node:14868) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'buffer'
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:175:30
at Generator.next ()
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
at new Promise ()
at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:174:12)
at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:53:9)
at CallExpression (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:113:53)
(node:14868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14868) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:14868) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'fs'
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:175:30
at Generator.next ()
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
at new Promise ()
at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:174:12)
at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:53:9)
at CallExpression (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:113:53)
(node:14868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:14868) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'util'
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:175:30
at Generator.next ()
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
at new Promise ()
at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:174:12)
at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:53:9)
at CallExpression (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:113:53)
(node:14868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:14868) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'stream'
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:175:30
at Generator.next ()
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
at new Promise ()
at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:174:12)
at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:53:9)
at CallExpression (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:113:53)
(node:14868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:14868) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'zlib'
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:175:30
at Generator.next ()
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
at new Promise ()
at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:174:12)
at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:53:9)
at CallExpression (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:113:53)
(node:14868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
(node:14868) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'assert'
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:175:30
at Generator.next ()
at C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:7:71
at new Promise ()
at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:3:12)
at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:174:12)
at resolveNpmFilesPath (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:53:9)
at CallExpression (C:\Users\Administrator\AppData\Roaming\npm\node_modules@tarojs\cli\dist\util\resolve_npm_files.js:113:53)
(node:14868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)`

【package.json】
{ "name": "GoJoy-H5", "version": "1.0.0", "private": true, "description": "", "main": "index.js", "scripts": { "build:weapp": "taro build --type weapp", "build:swan": "taro build --type swan", "build:alipay": "taro build --type alipay", "build:tt": "taro build --type tt", "build:h5": "taro build --type h5", "build:rn": "taro build --type rn", "dev:weapp": "npm run build:weapp -- --watch", "dev:swan": "npm run build:swan -- --watch", "dev:alipay": "npm run build:alipay -- --watch", "dev:tt": "npm run build:tt -- --watch", "dev:h5": "npm run build:h5 -- --watch", "dev:rn": "npm run build:rn -- --watch" }, "author": "", "license": "MIT", "dependencies": { "@tarojs/components": "1.3.0-beta.8", "@tarojs/mobx": "1.3.0-beta.8", "@tarojs/mobx-h5": "1.3.0-beta.8", "@tarojs/mobx-rn": "1.3.0-beta.8", "@tarojs/rn-runner": "1.3.0-beta.8", "@tarojs/router": "1.3.0-beta.8", "@tarojs/taro": "1.3.0-beta.8", "@tarojs/taro-alipay": "1.3.0-beta.8", "@tarojs/taro-h5": "1.3.0-beta.8", "@tarojs/taro-swan": "1.3.0-beta.8", "@tarojs/taro-tt": "1.3.0-beta.8", "@tarojs/taro-weapp": "1.3.0-beta.8", "axios": "^0.18.0", "cookies-js": "^1.2.3", "copy-to-clipboard": "^3.0.8", "marked": "^0.6.2", "mobx": "^4.8.0", "nerv-devtools": "^1.4.0", "nervjs": "^1.4.0", "qrcode": "^1.3.3", "react-zmage": "^0.7.5", "taro-ui": "^2.1.0" }, "devDependencies": { "@types/react": "16.3.14", "@types/webpack-env": "^1.13.6", "@tarojs/plugin-babel": "1.3.0-beta.8", "@tarojs/plugin-csso": "1.3.0-beta.8", "@tarojs/plugin-sass": "1.3.0-beta.8", "@tarojs/plugin-uglifyjs": "1.3.0-beta.8", "@tarojs/webpack-runner": "1.3.0-beta.8", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-jsx-stylesheet": "^0.6.5", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.6.1", "babel-eslint": "^8.2.3", "eslint": "^4.19.1", "eslint-config-taro": "1.3.0-beta.8", "eslint-plugin-react": "^7.8.2", "eslint-plugin-import": "^2.12.0", "eslint-plugin-taro": "1.3.0-beta.8" } }

@PopperLi
Copy link

【H5编译报错】
`创建 发现文件 src\components\wemark\prism.wxss
创建 发现文件 src\components\wemark\remarkable.js

<--- Last few GCs --->

[12512:000001FAAA954F50] 7903 ms: Scavenge 118.1 (140.7) -> 110.0 (145.7) MB, 26.9 / 0.0 ms (average mu = 0.991, current mu = 0.992) allocation failure
[12512:000001FAAA954F50] 7944 ms: Scavenge 121.9 (145.7) -> 110.9 (148.7) MB, 2.6 / 0.0 ms (average mu = 0.991, current mu = 0.992) allocation failure
[12512:000001FAAA954F50] 8056 ms: Scavenge 125.3 (148.7) -> 118.9 (151.2) MB, 8.6 / 0.0 ms (average mu = 0.991, current mu = 0.992) allocation failure

<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: NewSpace::Rebalance Allocation failed - JavaScript heap out of memory
1: 00007FF6059D0EFA
2: 00007FF6059AA296
3: 00007FF6059AAC80
4: 00007FF605C409BE
5: 00007FF605C408EF
6: 00007FF60617E954
7: 00007FF605E5C02A
8: 00007FF6061753C1
9: 00007FF60617449E
10: 00007FF60617362C
11: 00007FF60617C5A7
12: 00007FF60617C626
13: 00007FF605D1F278
14: 00007FF605D1FBF2
15: 00007FF605F63120
16: 00007FF605F60199
17: 00007FF605F60641
18: 00007FF6061C2633
19: 0000034A7655C5C1
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] build:h5: taro build --type h5
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] build:h5 script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2019-06-12T03_09_35_452Z-debug.log`

@shynome
Copy link

shynome commented Jun 12, 2019

#3389

@tianleiwufeng
Copy link

tianleiwufeng commented Jun 13, 2019

v1.3.0-beta.8 h5编译失败 小程序没问题
ℹ️ Listening at http://127.0.0.1:10086/


监听文件修改中...

🙅   Failed to compile.

  Error: webpack-internal:///./node_modules/webpack/buildin/harmony-module.js:29
  /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(m  odule)))//# sourceURL=[module]
                                                                                                                                            ^
  TypeError: __webpack_require__(...) is not a function

  - harmony-module.js:29 eval
    [.]/[webpack]/buildin/harmony-module.js:29:139

  - index.html:1882 Module../node_modules/webpack/buildin/harmony-module.js
    D:/project/cloudpin_mini/src/index.html:1882:1

  - index.html:684 __webpack_require__
    D:/project/cloudpin_mini/src/index.html:684:30

  - index.html:61 fn
    D:/project/cloudpin_mini/src/index.html:61:20

  - global.js:24 eval
    [.]/[webpack]/buildin/global.js:24:41

  - index.html:1870 Module../node_modules/webpack/buildin/global.js
    D:/project/cloudpin_mini/src/index.html:1870:1

  - index.html:684 __webpack_require__
    D:/project/cloudpin_mini/src/index.html:684:30

  - index.html:61 fn
    D:/project/cloudpin_mini/src/index.html:61:20

  - lodash.js:17101 eval
    [.]/[lodash]/lodash.js:17101:41

  - index.html:1858 Object../node_modules/lodash/lodash.js
    D:/project/cloudpin_mini/src/index.html:1858:1

PS D:\project\cloudpin_mini> taro info
👽 Taro v1.3.0-beta.8

Taro CLI 1.3.0-beta.8 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.14.2 - D:\nodejs\node.EXE
Yarn: 1.13.0 - D:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - D:\nodejs\npm.CMD

确定项目内的tarojs依赖都是v1.3.0-beta.8
image

------补充
是因为config/index 里babel 的plugin 配置了'transform-runtime' 导致,删了就好了
至于为什么会导致,就不知道了

@sprout-echo
Copy link

转为h5,其他页面用router.push回到首页,首页都会重复显示,这个问题只能通过在h5页面都用router.replace来解决吗

@NotMeIsMe
Copy link

编译rn时,.rn_temp目录中没有bandle目录,也没有自动打开一个终端。请问,1.3.0版本中说不再使用Expo,那现在官方文档是否是已经更新了的状态?

@7nights
Copy link

7nights commented Jun 21, 2019

函数式组件中的 jsx 无法拿到正确的 this:

class MyComponent extends Taro.Component {
state = {
  count: 0
};
renderMyComponent() {
  console.log(this.state.count); // 能够正确打印
  const { count } = this.state;
  return <Text>{this.state.count} {count}</Text>; // 前一个是 undefined,后一个正确 count 值
}
render () {
    return (
      <View className='index' text='test text'>
        <Text>Hello world! {this.state.count}</Text>
        <View onClick={() => {
          this.setState({
            count: this.state.count + 1
          });
        }}>{this.renderMyComponent()}</View>
      </View>
    )
  }
}
}

这个虽然在控制台中会提示,但是想知道这样限制的原因?

@yuche yuche closed this as completed Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests