NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.36k stars 4.77k forks source link

引入TaroUI 后报错:TypeError: Class extends value undefined is not a constructor or null #13481

Closed ganyanchuan1989 closed 1 year ago

ganyanchuan1989 commented 1 year ago

相关平台

H5

复现仓库

https://github.com/ganyanchuan1989/taro-demo-3.6.2.git 浏览器版本: chrome 109.0.5414.120(64 bit) 使用框架: React

复现步骤

  1. git clone https://github.com/ganyanchuan1989/taro-demo-3.6.2.git
  2. cd taro-demo-3.6.2
  3. npm install
  4. npm run dev:h5

期望结果

正常显示AtButton

实际结果

Error TypeError: Class extends value undefined is not a constructor or null

环境信息

👽 Taro v3.6.2

  Taro CLI 3.6.2 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.17.6 - D:\devhome\nodejs_home\node.EXE
      npm: 6.14.15 - D:\devhome\nodejs_home\npm.CMD
ganyanchuan1989 commented 1 year ago

补充信息,以下是创建taro-demo-3.6.2工程的选项配置:

Taro 即将创建一个新项目!
Need help? Go and open issue: https://tls.jd.com/taro-issue-helper

? 请输入项目介绍 taro demo
? 请选择框架 React
? 是否需要使用 TypeScript ? No
? 请选择 CSS 预处理器(Sass/Less/Stylus) Sass
? 请选择编译工具 Webpack5
? 请选择包管理工具 npm
? 请选择模板源 Github(最新)
√ 拉取远程模板仓库成功!
? 请选择模板 默认模板
ganyanchuan1989 commented 1 year ago

在没有引入taro-ui组件的时候,项目是正常的。引入taro-ui组件后,启动后打开页面就报错。

ganyanchuan1989 commented 1 year ago

问题解决,应该是组件库问题。使用:"taro-ui": "^3.1.0-beta.4",之后好了。

ZakaryCode commented 1 year ago

ok

ganyanchuan1989 commented 1 year ago

@ZakaryCode 3.1.0-beta.4 版本啥时候发布正式版哈,现在正式版本是2.x , 新版的3.x 会有很大变化吗?

ganyanchuan1989 commented 1 year ago
<Input focus/>

或者

<AtInput/>

依旧报错,最终将taro版本降低到 3.5.12 ,重新创建项目解决。