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

不兼容 preact >= 10.22.1 #16315

Open
towry opened this issue Aug 15, 2024 · 1 comment
Open

不兼容 preact >= 10.22.1 #16315

towry opened this issue Aug 15, 2024 · 1 comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@towry
Copy link

towry commented Aug 15, 2024

相关平台

微信小程序

小程序基础库: latest
使用框架: Preact

复现步骤

TypeError: n2.contains is not a function

是由于 preact 一个 commit 引起的,见 preactjs/preact#4421 (comment)

期望结果

兼容 preact >= 10.22.1

实际结果

不兼容,报错导致页面空白

环境信息

👽 Taro v3.6.34


  Taro CLI 3.6.34 environment info:
    System:
      OS: macOS 14.5
      Shell: 3.7.1 - /nix/store/lfa5bn829h81f4iazzl2wpjw0hpylcjc-fish-3.7.1/bin/fish
    Binaries:
      Node: 18.16.0 - ~/.local/state/fnm_multishells/49968_1723702112322/bin/node
      npm: 9.5.1 - ~/.local/state/fnm_multishells/49968_1723702112322/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.34 => 3.6.34 
      @tarojs/components: 3.6.34 => 3.6.34 
      @tarojs/helper: 3.6.34 => 3.6.34 
      @tarojs/plugin-framework-react: 3.6.34 => 3.6.34 
      @tarojs/plugin-platform-alipay: 3.6.34 => 3.6.34 
      @tarojs/plugin-platform-h5: ^3.6.34 => 3.6.34 
      @tarojs/plugin-platform-jd: 3.6.34 => 3.6.34 
      @tarojs/plugin-platform-qq: 3.6.34 => 3.6.34 
      @tarojs/plugin-platform-swan: 3.6.34 => 3.6.34 
      @tarojs/plugin-platform-tt: 3.6.34 => 3.6.34 
      @tarojs/plugin-platform-weapp: 3.6.34 => 3.6.34 
      @tarojs/react: 3.6.34 => 3.6.34 
      @tarojs/router: 3.6.34 => 3.6.34 
      @tarojs/runtime: 3.6.34 => 3.6.34 
      @tarojs/shared: 3.6.34 => 3.6.34 
      @tarojs/taro: 3.6.34 => 3.6.34 
      @tarojs/taro-h5: 3.6.34 => 3.6.34 
      @tarojs/taro-loader: ^3.6.34 => 3.6.34 
      @tarojs/webpack5-runner: 3.6.34 => 3.6.34 
      babel-preset-taro: 3.6.34 => 3.6.34 
      eslint-config-taro: 3.6.34 => 3.6.34 
      react: ^18.0.0 => 18.3.1 


@HappyYA
Copy link
Contributor

HappyYA commented Aug 17, 2024

WX20240817-213533@2x
编译配置中增加如下代码,我的可以了。先把prebundle清空。

webpackChain(chain) {
    chain.resolve.plugin("tsconfig-paths").use(TsconfigPathsPlugin);
    chain.plugin("definePlugin").tap((args) => {
      const config = args[0];
      config.ENABLE_CONTAINS = true;
      return args;
    });
},

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
Status: Todo
Development

No branches or pull requests

2 participants