taro icon indicating copy to clipboard operation
taro copied to clipboard

TypeError: Cannot read property 'Component' of undefined

Open TuringZhu opened this issue 1 year ago • 3 comments

相关平台

微信小程序

复现仓库

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"

TuringZhu avatar Jul 30 '24 10:07 TuringZhu

我也遇到了

narutohinata avatar Aug 14 '24 15:08 narutohinata

请问解决了吗?

yetnelson avatar Aug 16 '24 07:08 yetnelson

这项目死了吗

renlindong avatar Sep 21 '24 06:09 renlindong

+1

h7ml avatar Oct 28 '24 08:10 h7ml

解决了吗?

polestarHui avatar Mar 24 '25 07:03 polestarHui

移除了 taro-ui 之后可以跑起来?taro-ui 的问题?

freemode1614 avatar Mar 31 '25 02:03 freemode1614