-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Preact TypeError: ReactDOM$1.createRoot is not a function #16690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
救命啊,旧的项目编译失败,升级到新的,又无法使用,现在要修改旧的版本代码,卡进度了 @Chen-jj 打工人,江湖救急 |
npx @tarojs/cliinit xxx 方式创建项目遇到同样问题。cli 的版本为 4.0.5
|
preact 版本问题,最新版的 preact/compat 导出的 version 是 18.x,并且调整了导出路径,改为像 React 18 一样采用 react-dom/client 来导出 createRoot 方法,这似乎没被 Taro 正确处理,折腾了一会我还是回到了之前的版本,目前来看,preact 10.20.2 是可用的 |
同样,第一步就卡住了,这体验...... |
同样遇到了这个问题,退回了 react |
这个bug怎么修复呢
|
|
最新taro 4.0.8似乎还有其他问题,回退preact到10.20.2之后index 页面显示空白,回退taro到4.0.6问题解决 |
回退preact的我4.08可以 |
app.js错误: |
还是不行 不知道咋搞了 头大 |
你的项目只留下一个启动页面,上传下或者发个链接,我给你看看 |
我的也不行 |
相关平台
微信小程序
小程序基础库: 2.33.0
使用框架: React
复现步骤
初始化项目 taro init myApp
选择Preact
编译可以成功,小程序打开控制台报错
期望结果
正常运行
实际结果
app.js错误:
TypeError: y.createRoot is not a function
at T (taro.js? [sm]:1)
at Y (taro.js? [sm]:1)
at Module._ (app.js? [sm]:1)
at l (runtime.js? [sm]:1)
at t (runtime.js? [sm]:1)
at Array.r [as push] (runtime.js? [sm]:1)
at app.js? [sm]:1
at S (WASubContext.js?t=wechat&s=1728721266612&v=2.28.1:1)
at appservice.js:7
at doWhenAllScriptLoaded (getmainpackage.js:7361)(env: Windows,mp,1.06.241
0102; lib: 2.28.1)
环境信息
The text was updated successfully, but these errors were encountered: