Closed Gino2333 closed 1 year ago
Taro 升级了 react-reconciler 至 v0.27,以支持 React18 的新特性。
经过排查,开启 debugReact 选项后,Taro会使用 React development 模式的代码,此时 react-reconciler 内部会读取一些仅在 development 下才有的属性,比如 isBatchingLegacy
,而这个属性 React v17 并没有抛出。
使用 React18 是 ok,因为它抛出了相关字段。
如果是新项目,建议直接升级到 React18;
如果是旧项目,且仍需要 debugReact 的功能,可能暂时不能使用新版本了。
这个得写到文档里(3.5升级指南) 因为项目的生态库也要同时升级到react18,还是挺麻烦的
这个得写到文档里(3.5升级指南) 因为项目的生态库也要同时升级到react18,还是挺麻烦的
@AdvancedCat 辛苦鑫哥抽空更新下文档~
相关平台
飞书小程序
复现仓库
git@github.com:Gino2333/FerishuTaroTest.git
使用框架: React
复现步骤
npm run dev:lark 使用飞书小程序开发者工具打开项目报错
[TMA][ERROR][RUNTIME] initApp fail, EngineError: -4026 Error: app service js execute fail: app-service.js load error: TypeError: Cannot read properties of undefined (reading 'isBatchingLegacy'), stack: TypeError: Cannot read properties of undefined (reading 'isBatchingLegacy') at ensureRootIsScheduled (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/vendors.js:45137:35) at scheduleUpdateOnFiber (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/vendors.js:44988:5) at Object.updateContainer (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/vendors.js:48366:14) at Root.render (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/taro.js:2117:38) at Object.render (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/taro.js:1859:29) at renderReactRoot (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/taro.js:490:90) at createReactApp (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/taro.js:555:21) at ./src/app.jsx (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/app.js:12073:134) at __webpack_require__ (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/runtime.js:71:36) at checkDeferredModules (file:///Users/zhanghao/.mpdev-ide/builds/f49d9074c9b0a3868aa302f47680cefd/__dist__/runtime.js:43:35)
期望结果
小程序正常运行
实际结果
小程序无法启动
环境信息