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

无法使用 MutationObserver #14664

Closed
lxk1080 opened this issue Oct 16, 2023 · 2 comments · Fixed by #14764
Closed

无法使用 MutationObserver #14664

lxk1080 opened this issue Oct 16, 2023 · 2 comments · Fixed by #14764
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@lxk1080
Copy link

lxk1080 commented Oct 16, 2023

相关平台

微信小程序

小程序基础库: 3.1.2
使用框架: React

复现步骤

使用类似于 web 端的 API,new MutationObserver(),提示:[Taro Warning] 若要使用 MutationObserver,请在 Taro 编译配置中设置 'mini.enableMutationObserver: true'。在项目文件的 config 下的 dev.ts 中配置后,仍然弹出提示,并未生效。

期望结果

MutationObserver API 可用

实际结果

MutationObserver API 不可用

环境信息

Taro v3.6.16


  Taro CLI 3.6.16 environment info:
    System:
      OS: macOS 13.4
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 18.16.0 - /Users/apps/.nvm/versions/node/v18.16.0/bin/node
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 9.5.1 - /Users/apps/.nvm/versions/node/v18.16.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.16 => 3.6.16 
      @tarojs/components: 3.6.16 => 3.6.16 
      @tarojs/helper: 3.6.16 => 3.6.16 
      @tarojs/plugin-framework-react: 3.6.16 => 3.6.16 
      @tarojs/plugin-platform-alipay: 3.6.16 => 3.6.16 
      @tarojs/plugin-platform-h5: 3.6.16 => 3.6.16 
      @tarojs/plugin-platform-jd: 3.6.16 => 3.6.16 
      @tarojs/plugin-platform-qq: 3.6.16 => 3.6.16 
      @tarojs/plugin-platform-swan: 3.6.16 => 3.6.16 
      @tarojs/plugin-platform-tt: 3.6.16 => 3.6.16 
      @tarojs/plugin-platform-weapp: 3.6.16 => 3.6.16 
      @tarojs/react: 3.6.16 => 3.6.16 
      @tarojs/runtime: 3.6.16 => 3.6.16 
      @tarojs/shared: 3.6.16 => 3.6.16 
      @tarojs/taro: 3.6.16 => 3.6.16 
      @tarojs/taro-loader: 3.6.16 => 3.6.16 
      @tarojs/webpack5-runner: 3.6.16 => 3.6.16 
      babel-preset-taro: 3.6.16 => 3.6.16 
      eslint-config-taro: 3.6.16 => 3.6.16 
      react: ^18.0.0 => 18.2.0 
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Oct 16, 2023
@TheKonka
Copy link
Member

TheKonka commented Oct 16, 2023

没有复现,建议关闭 prebundle 重新编译试下

@Chen-jj
Copy link
Contributor

Chen-jj commented Nov 3, 2023

@lxk1080 不好意思,提示错了,应该是配置 mini.runtime.enableMutationObserver: true,我们改一下提示语

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

Successfully merging a pull request may close this issue.

3 participants