Open ko-yuki opened 1 year ago
微信小程序
小程序基础库: 2.33.0 使用框架: React
config文件中配置预编译文件后,执行 yarn dev:weapp 后查看终端错误信息
yarn dev:weapp
可以成功预渲染
编译后报错,Cannot read property 'onLaunch' of undefined , Cannot set property 'route' of undefined
Cannot read property 'onLaunch' of undefined
Cannot set property 'route' of undefined
Taro v3.6.6 Taro CLI 3.6.6 environment info: System: OS: Windows 10 10.0.19045 Binaries: Node: 14.11.0 - D:\dev-tools\node\node.EXE Yarn: 1.22.19 - D:\dev-tools\npm\global\yarn.CMD npm: 6.14.8 - D:\dev-tools\node\npm.CMD npmPackages: @tarojs/components: 3.6.6 => 3.6.6 @tarojs/mini-runner: 3.6.6 => 3.6.6 @tarojs/plugin-framework-react: 3.6.6 => 3.6.6 @tarojs/react: 3.6.6 => 3.6.6 @tarojs/runtime: 3.6.6 => 3.6.6 @tarojs/taro: 3.6.6 => 3.6.6 @tarojs/webpack5-runner: ^3.6.6 => 3.6.6 babel-preset-taro: 3.6.6 => 3.6.6 eslint-config-taro: 3.6.6 => 3.6.6 react: ^16.10.0 => 16.14.0
重现地址https://github.com/ko-yuki/taro-bugs/tree/prerender-3.6.6
@Chen-jj 有没有解决方案👀
解决了嘛?
相关平台
微信小程序
小程序基础库: 2.33.0 使用框架: React
复现步骤
config文件中配置预编译文件后,执行
yarn dev:weapp
后查看终端错误信息期望结果
可以成功预渲染
实际结果
编译后报错,![Dingtalk_20230817150107](https://github.com/NervJS/taro/assets/88355388/d0f684c1-5d41-4084-8d3e-f0d6b30be338)
Cannot read property 'onLaunch' of undefined
,Cannot set property 'route' of undefined
环境信息