You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wx:if 的值需要用双括号 `{{}}` 包裹它的值
错误 页面转换 pages/goodsDetail/goodsDetail.js
TypeError: Cannot read property 'expression' of null
at C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\@tarojs\taroize\lib\src\wxml.js:432:61
at Array.reduceRight (<anonymous>)
at handleConditions (C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\@tarojs\taroize\lib\src\wxml.js:431:14)
at transformIf (C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\@tarojs\taroize\lib\src\wxml.js:410:5)
at jsxAttrVisitor (C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\@tarojs\taroize\lib\src\wxml.js:51:9)
at NodePath._call (C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\babel-traverse\lib\path\context.js:76:18)
at NodePath.call (C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\babel-traverse\lib\path\context.js:48:17)
at NodePath.visit (C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\babel-traverse\lib\path\context.js:105:12)
at TraversalContext.visitQueue (C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\babel-traverse\lib\context.js:150:16)
at TraversalContext.visitMultiple (C:\Users\f00381993\AppData\Local\Yarn\Data\global\node_modules\babel-traverse\lib\context.js:103:17)
问题描述
微信小程序wxml写法如下:
<view wx:if= "{{data.test}}"></view>
微信编译器可以过滤掉wx:if后面的空白字符
但是在taro convert的过程中会报错,导致无法转换为taro的标签,出现这种问题一般不好排查,因为页面中类似标签太多了
复现步骤
1.在微信小程序根目录执行 taro convert
2.打开taroconvert目录,执行yarn
3.执行yarn build:weapp
期望行为
微信小程序代码成功taro化
报错信息
系统信息
操作系统: Windows 10
Taro 版本 v1.3.12
Node.js 版本 v12.7.0
报错平台 weapp
补充信息
在转换过程中使用空白字符正则过滤之后再进行转换
The text was updated successfully, but these errors were encountered: