taro icon indicating copy to clipboard operation
taro copied to clipboard

taro4 官方脚手架创建的 vite react 工程,使用虚拟滚动组件报错

Open javaxiu opened this issue 5 months ago • 3 comments

相关平台

微信小程序

复现仓库

https://github.com/javaxiu/taro_vite_virtual_list.git 小程序基础库: 3.5.7 使用框架: React

复现步骤

  1. 官方脚手架 4.0.5 版本,创建 vite 模板
  2. 复制粘贴官方文档的 virtual list 例子 https://docs.taro.zone/docs/virtual-list 代码
  3. 执行 npm run dev:weapp
  4. 小程序 IDE 打开,看到白屏,调试发现 VirtualList 组件为空,源码处是 taro.VirtualList

期望结果

正常执行并渲染出来预期的demo

实际结果

vite 版本有问题,webpack 没有问题

环境信息

Taro CLI 4.0.5 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 20.17.0 - C:\Program Files\nodejs\node.EXE
      npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.5 => 4.0.5
      @tarojs/components: 4.0.5 => 4.0.5
      @tarojs/components-advanced: ^4.0.5 => 4.0.5
      @tarojs/helper: 4.0.5 => 4.0.5
      @tarojs/plugin-framework-react: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-alipay: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-h5: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-jd: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-qq: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-swan: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-tt: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-weapp: 4.0.5 => 4.0.5
      @tarojs/react: 4.0.5 => 4.0.5
      @tarojs/runtime: 4.0.5 => 4.0.5
      @tarojs/shared: 4.0.5 => 4.0.5
      @tarojs/taro: 4.0.5 => 4.0.5
      @tarojs/taro-loader: 4.0.5 => 4.0.5
      @tarojs/webpack5-runner: 4.0.5 => 4.0.5
      babel-preset-taro: 4.0.5 => 4.0.5
      eslint-config-taro: 4.0.5 => 4.0.5
      react: ^18.0.0 => 18.3.1

javaxiu avatar Sep 13 '24 11:09 javaxiu