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

引入@tarojs/plugin-react-devtools后报错 TypeError: Cannot read property 'hasOwnProperty' of undefined #17204

Open
izbj opened this issue Jan 18, 2025 · 1 comment

Comments

@izbj
Copy link

izbj commented Jan 18, 2025

相关平台

微信小程序

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

复现步骤

执行taro build --type weapp --watch后,微信开发者工具控制台报错如下:
app.js错误:
TypeError: Cannot read property 'hasOwnProperty' of undefined
at installHook (vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-react-devtools_dist_runtime_js.js?t=wechat&s=1737207710854&v=79cf794e7c669768104aef5cbf637c6a:10535)
at Module. (vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-react-devtools_dist_runtime_js.js?t=wechat&s=1737207710854&v=79cf794e7c669768104aef5cbf637c6a:11972)
at nested_webpack_require_879 (vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-react-devtools_dist_runtime_js.js?t=wechat&s=1737207710854&v=79cf794e7c669768104aef5cbf637c6a:45)
at vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-react-devtools_dist_runtime_js.js?t=wechat&s=1737207710854&v=79cf794e7c669768104aef5cbf637c6a:97
at vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-react-devtools_dist_runtime_js.js?t=wechat&s=1737207710854&v=79cf794e7c669768104aef5cbf637c6a:98
at webpackUniversalModuleDefinition (vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-react-devtools_dist_runtime_js.js?t=wechat&s=1737207710854&v=79cf794e7c669768104aef5cbf637c6a:29)
at node_modules/@tarojs/plugin-react-devtools/dist/backend/index.js (vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-react-devtools_dist_runtime_js.js?t=wechat&s=1737207710854&v=79cf794e7c669768104aef5cbf637c6a:33)
at __require (node_modules_taro_weapp_prebundle_react_js.js?t=wechat&s=1737207710854&v=8635ed1d373317ed44dd1735cbda54e2:28)
at Object../node_modules/.taro/weapp/prebundle/@tarojs_plugin-react-devtools_dist_runtime.js (vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-react-devtools_dist_runtime_js.js?t=wechat&s=1737207710854&v=79cf794e7c669768104aef5cbf637c6a:12214)
at webpack_require (webpack_bootstrap:19)(env: macOS,mp,1.06.2412050; lib: 3.7.5)

期望结果

正常使用react-devtools

实际结果

未能正常使用react-devtools

环境信息

  Taro CLI 4.0.9 environment info:
    System:
      OS: macOS 15.2
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 22.2.0 - /opt/homebrew/bin/node
      Yarn: 1.22.18 - /opt/homebrew/bin/yarn
      npm: 10.7.0 - /opt/homebrew/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.9 => 4.0.9 
      @tarojs/components: 4.0.9 => 4.0.9 
      @tarojs/components-rn: 4.0.9 => 4.0.9 
      @tarojs/helper: 4.0.9 => 4.0.9 
      @tarojs/plugin-framework-react: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-alipay: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-h5: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-jd: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-qq: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-swan: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-tt: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-weapp: 4.0.9 => 4.0.9 
      @tarojs/plugin-react-devtools: ^4.0.9 => 4.0.9 
      @tarojs/react: 4.0.9 => 4.0.9 
      @tarojs/rn-runner: 4.0.9 => 4.0.9 
      @tarojs/rn-supporter: 4.0.9 => 4.0.9 
      @tarojs/runtime: 4.0.9 => 4.0.9 
      @tarojs/runtime-rn: 4.0.9 => 4.0.9 
      @tarojs/shared: 4.0.9 => 4.0.9 
      @tarojs/taro: 4.0.9 => 4.0.9 
      @tarojs/taro-loader: 4.0.9 => 4.0.9 
      @tarojs/taro-rn: 4.0.9 => 4.0.9 
      @tarojs/webpack5-runner: 4.0.9 => 4.0.9 
      babel-preset-taro: 4.0.9 => 4.0.9 
      eslint-config-taro: 4.0.9 => 4.0.9 
      expo: ~50.0.21 => 50.0.21 
      react: ^18.3.1 => 18.3.1 
      react-native: ^0.73.11 => 0.73.11 
      stylelint-taro-rn: 4.0.9 => 4.0.9 
@izbj
Copy link
Author

izbj commented Jan 18, 2025

taro 3.6.35 可以正常使用react devtool,4.0.9无法使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant