Skip to content
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

export 'flushSync' (imported as 'flushSync') was not found in 'react-dom' #14863

Open
ueaner opened this issue Nov 21, 2023 · 5 comments
Open
Labels
enhancement New feature or request F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@ueaner
Copy link

ueaner commented Nov 21, 2023

相关平台

微信小程序

复现仓库

https://github.com/ueaner/taro-flushsync.git
小程序基础库: 1.06.2310080
使用框架: React

复现步骤

git clone https://github.com/ueaner/taro-flushsync.git
cd taro-flushsync
pnpm i
pnpm run build:weapp 

期望结果

正常通过构建

实际结果

无法通过构建(这里提供的最小示例产生 warning, 但实际项目中同样的问题还产生了 Error

环境信息

👽 Taro v3.6.19


  Taro CLI 3.6.19 environment info:
    System:
      OS: macOS 12.7.1
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 20.9.0 - /tmp/run-ueaner.501ovL/fnm_multishells/666_1700546716777/bin/node
      npm: 10.1.0 - /tmp/run-ueaner.501ovL/fnm_multishells/666_1700546716777/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.19 => 3.6.19
      @tarojs/components: 3.6.19 => 3.6.19
      @tarojs/helper: 3.6.19 => 3.6.19
      @tarojs/plugin-framework-react: 3.6.19 => 3.6.19
      @tarojs/plugin-platform-alipay: 3.6.19 => 3.6.19
      @tarojs/plugin-platform-h5: 3.6.19 => 3.6.19
      @tarojs/plugin-platform-jd: 3.6.19 => 3.6.19
      @tarojs/plugin-platform-qq: 3.6.19 => 3.6.19
      @tarojs/plugin-platform-swan: 3.6.19 => 3.6.19
      @tarojs/plugin-platform-tt: 3.6.19 => 3.6.19
      @tarojs/plugin-platform-weapp: 3.6.19 => 3.6.19
      @tarojs/react: 3.6.19 => 3.6.19
      @tarojs/runtime: 3.6.19 => 3.6.19
      @tarojs/shared: 3.6.19 => 3.6.19
      @tarojs/taro: 3.6.19 => 3.6.19
      @tarojs/taro-loader: 3.6.19 => 3.6.19
      @tarojs/webpack5-runner: 3.6.19 => 3.6.19
      babel-preset-taro: 3.6.19 => 3.6.19
      eslint-config-taro: 3.6.19 => 3.6.19
      react: ^18.0.0 => 18.2.0


补充信息

基于一个现有的 React 项目转微信小程序,业务中有比较多的使用浮动窗口/提示,需要渲染的地方,不确定 Taro 是否处理了 flushSync, 只在 Taro 的代码中发现一处 TaroReconciler.flushSync() 的调用。作为前端新手不确定描述是否准确,需要提供更多信息,或者配合测试,请一定告知。Taro 是一个很棒的项目,感谢您的付出!

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Nov 21, 2023
@Chen-jj
Copy link
Contributor

Chen-jj commented Nov 28, 2023

Taro Reconciler 应该还没有兼容此 API。

@Chen-jj Chen-jj added the enhancement New feature or request label Nov 28, 2023
@ueaner
Copy link
Author

ueaner commented Dec 1, 2023

@Chen-jj 请问计划在哪个版本兼容下?或者怎么兼容,我可以做些什么?

@oddguan
Copy link

oddguan commented May 10, 2024

顶一下这里。同样遇到了此问题。如果不支持此 api 的话请问有什么兼容办法吗?

@chenershisi
Copy link

+1,现在有什么解决办法吗?

@AprildreamMI
Copy link

+1,啥时候可以支持flushSync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
Status: Todo
Development

No branches or pull requests

5 participants