Skip to content

taro使用webpack5进行开发时编译后, 报错找不到模板 WXMLRT_$gwx:./base.wxml:template:377:16: Template tmpl_0_21 not found. #12553

@ymq001

Description

@ymq001

相关平台

微信小程序

复现仓库

https://github.com/ymq001/taro-bug-repo
小程序基础库: 2.26.0
使用框架: React

复现步骤

运行 dev:weapp
在 page/index/index.tsx 中使用 AtButton 组件

  <AtButton
          className="nl-button"
          type="primary"
          circle={true}
          openType="getPhoneNumber"
          onGetPhoneNumber={this.handleGetPhoneNumber.bind(this)}
        >
          获取手机号
</AtButton>

报错:

VM1093:22 WXMLRT_$gwx:./base.wxml:template:205:16: Template `tmpl_0_21` not found.
[WXML Runtime warning] ./base.wxml
 Template `tmpl_0_21` not found.
  203 | 
  204 | <template name="tmpl_2_container">
> 205 |   <template is="{{xs.a(2, i.nn, l)}}" data="{{i:i,cid:2,l:xs.f(l,i.nn)}}" />
      |                ^
  206 | </template>
  207 | 
  208 | <template name="tmpl_3_0">

期望结果

运行 dev:weapp 命令时,不会出现报错,且组件无法正常使用的情况

实际结果

运行 dev:weapp 命令时,出现报错,且组件无法正常使用

环境信息

  Taro CLI 3.5.5 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.16.1 - D:\Program\nodejs\node.EXE
      Yarn: 1.19.0 - C:\Users\admin\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.12 - D:\Program\nodejs\npm.CMD

Metadata

Metadata

Assignees

Labels

F-reactFramework - ReactP-2Medium, minor/patchT-weappTarget - 编译到微信小程序V-3Version - 3.x

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions