小程序报错Cannot read property '$$' of undefined

最近在练习小程序,写了一个swiper的轮播功能,打算做成一个模块放在独立的文件夹中方便导入使用,但是出现了报错情况,代码以及报错情况如下,试过current:0,无效,缓存没有找到很好的办法写入。
轮播功能代码

报错信息 [渲染层错误] TypeError: Cannot read property '$$' of undefined at HTMLElement._attached.o._touchstartHandlerForDevtools (http://127.0.0.1:21285/__pageframe__/__dev__/WAWebview.js?t=wechat&s=1625795366898&v=2.17.0:2:1085880)(env: Windows,mp,1.05.2105170; lib: 2.17.0) [渲染层错误] Uncaught TypeError: Cannot read property '$$' of undefined(env: Windows,mp,1.05.2105170; lib: 2.17.0)

轮播功能代码

<!--modules/carousel/carousel.wxml-->
<template name="carousel">
  <view>
    <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
      <block wx:for="{{imgUrls}}" wx:key="key">
        <swiper-item>
          <image src="{{item}}" style="width:100%"/>
        </swiper-item>
      </block>
    </swiper>
  </view>
</template>

楼主这个是怎么解决的,我的也是这个问题

楼主解决了吗 我也出现了相同问题

无发读取$$的属性。你搜一下,有没有$$这个,然后做个判断if(obj.$$){//在使用}。