使用新版taro配合taroui出现这个问题?
-
� Taro v3.0.0-rc.6
生成 工具配置 D:\x-20200623\converter\dist/project.config.json
编译 发现入口 src/app.jsx
编译 发现页面 src/pages/index/index.jsx
编译 发现页面 src/pages/set/set.jsx
编译 发现页面 src/pages/projectManage/projectManage.jsx
� 编译失败../node_modules/_taro-ui@2.3.4@taro-ui/dist/weapp/common/component.tsx
Module build failed (from ./node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js):
SyntaxError: D:\x-20200623\converter\node_modules_taro-ui@2.3.4@taro-ui\dist\weapp\common\component.tsx: Unexpected token, expected "," (3:29)1 | import { Component } from '@tarojs/taro'
2 |3 | const objectToString = (style: object | string): string => {
| ^
4 | if (style && typeof style === 'object') {
5 | let styleStr = ''
6 | Object.keys(style).forEach(key => {监听文件修改中...
./node_modules/_taro-ui@2.3.4@taro-ui/dist/weapp/common/component.tsx
Module build failed (from ./node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js):
SyntaxError: D:\x-20200623\converter\node_modules_taro-ui@2.3.4@taro-ui\dist\weapp\common\component.tsx: Unexpected token, expected "," (3:29)1 | import { Component } from '@tarojs/taro'
2 |3 | const objectToString = (style: object | string): string => {
| ^
4 | if (style && typeof style === 'object') {
5 | let styleStr = ''
6 | Object.keys(style).forEach(key => {
at Object._raise (D:\x-20200623\converter\node_modules_@babel_parser@7.10.4@@babel\parser\src\parser\error.js:60:45)
at Object.raiseWithData (D:\x-20200623\converter\node_modules_@babel_parser@7.10.4@@babel\parser\src\parser\error.js:55:17)
at Object.raise (D:\x-20200623\converter\node_modules_@babel_parser@7.10.4@@babel\parser\src\parser\error.js:39:17)
at Object.unexpected (D:\x-20200623\converter\node_modules_@babel_parser@7.10.4@@babel\parser\src\parser\util.js:152:16)
-
@不明飞行吻 在 使用新版taro配合taroui出现这个问题? 中说:
component
今天也遇到这个问题,看提示 是 因为 tsx 出现的问题 ,请官方来看看
-
如果不使用taro ui就没有问题,import { AtButton } from 'taro-ui' 随便引入一个,编译就报错。。。
-
@好大一根木头 已经在issues上找到办法,安装对应版本taro ui ,具体版本是
taro-ui@3.0.0-alpha.2
-
此回复已被删除!
-
@不明飞行吻
你这边问题解决了吗?
我升级 taro-ui 3.0.0-alpha.2 之后,build 是成功了,但是 在 支付宝小程序内打开还是 报错
3.0.0-alpha.2
//错误如下
TypeError: Super expression must either be null or a function
-
@好大一根木头 不清楚,因为我没有编译支付宝,只用了微信编译
-
@不明飞行吻 使用taro-ui@3.0.0-alpha.2 按taro-ui的官网方法按需加载,打包的体积是全量的?你是怎么解决的
-
@好大一根木头 请问你这个问题解决了吗?
-
@好大一根木头 这个应该是Component继承问题,看一下是不是全部继承的React或者taro/component