taro
taro copied to clipboard
Template `tmpl_0_XXXX` not found. 混合原生小程序组件丢失
相关平台
微信小程序
小程序基础库: 3.3.0 使用框架: React
复现步骤
按照官方文档 https://docs.taro.zone/docs/hybrid Taro 使用原生模块
引入组件之后出现问题
```WXMLRT_$gwx_XC_4:./base.wxml:template:27:20: Template tmpl_0_xr-framebox not found.
[WXML Runtime warning] ./base.wxml
Template tmpl_0_xr-framebox not found.
25 |
27 | | ^ 28 | 29 | 30 | ```
期望结果
正常渲染混合原生组件
实际结果
各种报错最终变成黄色警告 无法渲染组件
环境信息
Taro CLI 3.6.21 environment info:
System:
OS: macOS 12.7
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 21.5.0 - /usr/local/bin/node
npm: 10.2.4 - /usr/local/bin/npm
npmPackages:
@tarojs/cli: 3.6.21 => 3.6.21
@tarojs/components: 3.6.21 => 3.6.21
@tarojs/helper: 3.6.21 => 3.6.21
@tarojs/plugin-framework-react: 3.6.21 => 3.6.21
@tarojs/plugin-platform-alipay: 3.6.21 => 3.6.21
@tarojs/plugin-platform-h5: 3.6.21 => 3.6.21
@tarojs/plugin-platform-jd: 3.6.21 => 3.6.21
@tarojs/plugin-platform-qq: 3.6.21 => 3.6.21
@tarojs/plugin-platform-swan: 3.6.21 => 3.6.21
@tarojs/plugin-platform-tt: 3.6.21 => 3.6.21
@tarojs/plugin-platform-weapp: 3.6.21 => 3.6.21
@tarojs/react: 3.6.21 => 3.6.21
@tarojs/runtime: 3.6.21 => 3.6.21
@tarojs/shared: 3.6.21 => 3.6.21
@tarojs/taro: 3.6.21 => 3.6.21
@tarojs/taro-loader: 3.6.21 => 3.6.21
@tarojs/webpack5-runner: 3.6.21 => 3.6.21
babel-preset-taro: 3.6.21 => 3.6.21
eslint-config-taro: 3.6.21 => 3.6.21
react: ^18.0.0 => 18.2.0
补充信息
为什么按照官方文档却有各种各样的问题
关注一下这个问题
Try : NODE_ENV=production taro build --type weapp --watch
同样 3.6.21版本 。引入原生组件 无法渲染
同样的问题,蹲
同样 3.6.21版本 。引入原生组件 无法渲染
Taro v3.6.34 dev watch模式下会有这个问题,scroll-view无法加载slot
prod模式下没有问题
[WXML Runtime warning] ./base.wxml
Template `tmpl_0_62` not found.
65 | <scroll-view scroll-x="{{xs.b(i.p33,!1)}}" scroll-y="{{xs.b(i.p34,!1)}}" upper-threshold="{{xs.b(i.p37,50)}}" lower-threshold="{{xs.b(i.p9,50)}}" scroll-top="{{i.p31}}" scroll-left="{{i.p30}}" scroll-into-view="{{i.p27}}" scroll-with-animation="{{xs.b(i.p32,!1)}}" enable-back-to-top="{{xs.b(i.p4,false)}}" bindscrolltoupper="eh" bindscrolltolower="eh" bindscroll="eh" bindtouchstart="eh" bindtouchmove="eh" bindtouchend="eh" bindtouchcancel="eh" bindlongpress="eh" animation="{{i.p0}}" bindanimationstart="eh" bindanimationiteration="eh" bindanimationend="eh" bindtransitionend="eh" enable-flex="{{xs.b(i.p5,false)}}" scroll-anchoring="{{xs.b(i.p26,false)}}" enhanced="{{xs.b(i.p7,false)}}" using-sticky="{{xs.b(i.p38,false)}}" paging-enabled="{{xs.b(i.p12,false)}}" enable-passive="{{xs.b(i.p6,false)}}" refresher-enabled="{{xs.b(i.p16,false)}}" refresher-threshold="{{xs.b(i.p17,45)}}" refresher-default-style="{{xs.b(i.p15,'black')}}" refresher-background="{{xs.b(i.p13,'#FFF')}}" refresher-triggered="{{xs.b(i.p18,false)}}" bounces="{{xs.b(i.p1,true)}}" show-scrollbar="{{xs.b(i.p35,true)}}" fast-deceleration="{{xs.b(i.p8,false)}}" type="{{xs.b(i.p36,'list')}}" reverse="{{xs.b(i.p25,false)}}" clip="{{xs.b(i.p3,true)}}" cache-extent="{{i.p2}}" min-drag-distance="{{xs.b(i.p10,18)}}" scroll-into-view-within-extent="{{xs.b(i.p29,false)}}" scroll-into-view-alignment="{{xs.b(i.p28,'start')}}" padding="{{xs.b(i.p11,[0,0,0,0])}}" refresher-two-level-enabled="{{xs.b(i.p20,false)}}" refresher-two-level-triggered="{{xs.b(i.p24,false)}}" refresher-two-level-threshold="{{xs.b(i.p23,150)}}" refresher-two-level-close-threshold="{{xs.b(i.p19,80)}}" refresher-two-level-scroll-enabled="{{xs.b(i.p22,false)}}" refresher-ballistic-refresh-enabled="{{xs.b(i.p14,false)}}" refresher-two-level-pinned="{{xs.b(i.p21,false)}}" binddragstart="eh" binddragging="eh" binddragend="eh" bindrefresherpulling="eh" bindrefresherrefresh="eh" bindrefresherrestore="eh" bindrefresherabort="eh" bindscrollstart="eh" bindscrollend="eh" bindrefresherwillrefresh="eh" bindrefresherstatuschange="eh" style="{{i.st}}" class="{{i.cl}}" bindtap="eh" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
66 | <block wx:for="{{i.cn}}" wx:key="sid">
> 67 | <template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
| ^
68 | </block>
69 | </scroll-view>
70 | </template>
同样 3.6.21版本 。引入原生组件 无法渲染
我也遇到一样的问题,请问最后解决了吗?

