taro TypeError: Cannot read property 'Component' of undefined

qjp7pelc  于 3个月前  发布在  其他
关注(0)|答案(2)|浏览(51)

相关平台

微信小程序

复现仓库

https://gitlab.com/Turing7/mini_app_tmpl_taro_react.git
小程序基础库: 3.5.2
使用框架: React

复现步骤

在windows上执行 taro init PROJECT_NAME ,选择 react,npm,sass,github,taro-ui 参数.
然后编译并在微信开发者工具中预览

期望结果

出现Hello World等示例代码

实际结果

微信开发者工具中标题为首页,页面空白, 控制台报错

环境信息

PS D:\src\mini_app_taro_react> .\node_modules\.bin\taro.cmd info
👽 Taro v4.0.4

(node:28312) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

  Taro CLI 4.0.4 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 22.5.1 - D:\applications\node\node.EXE
      npm: 10.8.2 - D:\applications\node\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.4 => 4.0.4
      @tarojs/components: 4.0.4 => 4.0.4
      @tarojs/helper: 4.0.4 => 4.0.4
      @tarojs/plugin-framework-react: 4.0.4 => 4.0.4
      @tarojs/plugin-platform-alipay: 4.0.4 => 4.0.4
      @tarojs/plugin-platform-h5: 4.0.4 => 4.0.4
      @tarojs/plugin-platform-jd: 4.0.4 => 4.0.4
      @tarojs/plugin-platform-qq: 4.0.4 => 4.0.4
      @tarojs/plugin-platform-swan: 4.0.4 => 4.0.4
      @tarojs/plugin-platform-tt: 4.0.4 => 4.0.4
      @tarojs/plugin-platform-weapp: 4.0.4 => 4.0.4
      @tarojs/react: 4.0.4 => 4.0.4
      @tarojs/runtime: 4.0.4 => 4.0.4
      @tarojs/shared: 4.0.4 => 4.0.4
      @tarojs/taro: 4.0.4 => 4.0.4
      @tarojs/vite-runner: 4.0.4 => 4.0.4
      babel-preset-taro: 4.0.4 => 4.0.4
      eslint-config-taro: 4.0.4 => 4.0.4
      react: ^18.0.0 => 18.3.1
      taro-ui: ^3.2.1 => 3.3.0

PS D:\src\mini_app_taro_react>

补充信息

"name": "taro-ui",
"typescript": true,
"css": "Sass",
"framework": "React"

相关问题