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

react-devtools报错connectSocket is not a function #11438

Closed
fw6 opened this issue Mar 11, 2022 · 2 comments · Fixed by #11362
Closed

react-devtools报错connectSocket is not a function #11438

fw6 opened this issue Mar 11, 2022 · 2 comments · Fixed by #11362
Labels
F-react Framework - React V-3 Version - 3.x
Milestone

Comments

@fw6
Copy link
Contributor

fw6 commented Mar 11, 2022

相关平台

微信小程序

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

复现步骤

  1. 使用小程序插件模板(react)创建项目
  2. 安装@tarojs/plugin-react-devtools并配置完成
  3. 启动taro build --plugin weapp --watch
  4. 小程序开发者工具出现报错TypeError: _tarojs_taro__WEBPACK_IMPORTED_MODULE_2___default.a.connectSocket is not a function

期望结果

正常开启react devtools,插件页面正常渲染

实际结果

react devtools启动成功,控制台出现报错
插件页面无法打开

环境信息

Taro CLI 3.4.3 environment info:
    System:
      OS: macOS 12.2.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.18.2 - ~/.volta/tools/image/node/14.18.2/bin/node
      Yarn: 1.22.17 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
      npm: 6.14.15 - ~/.volta/tools/image/node/14.18.2/bin/npm
    npmPackages:
      @tarojs/components: 3.4.3 => 3.4.3 
      @tarojs/mini-runner: ^3.4.3 => 3.4.3 
      @tarojs/react: 3.4.3 => 3.4.3 
      @tarojs/runtime: 3.4.3 => 3.4.3 
      @tarojs/taro: 3.4.3 => 3.4.3 
      @tarojs/webpack-runner: 3.4.3 => 3.4.3 
      babel-preset-taro: 3.4.3 => 3.4.3 
      eslint-config-taro: 3.4.3 => 3.4.3 
      react: ^17.0.2 => 17.0.2 

image

image

@github-actions
Copy link
Contributor

等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!

Thank you so much!

@fw6
Copy link
Contributor Author

fw6 commented Mar 11, 2022

小程序插件打包模式下,先编译插件页面再编译miniprogram入口页面导致的?

image

image

@Chen-jj Chen-jj added V-3 Version - 3.x F-react Framework - React labels Mar 12, 2022
fw6 added a commit to fw6/taro that referenced this issue Mar 14, 2022
临时修复react-devtools在插件开发模式下报错问题;PR中根据代码建议调整写法

NervJS#11438
@Chen-jj Chen-jj added this to the 3.4.4 milestone Mar 27, 2022
Chen-jj added a commit that referenced this issue Mar 27, 2022
* fix(taro-alipay): 支付宝小程序插件配置字段缺失

支付宝小程序插件生成的plugin.json配置缺少pages

#11361

* fix(react): 修复小程序插件无法使用hooks问题

Taro专有 Hooks在小程序插件页面中可以使用

#11373

* test(ci): 更新测试结果快照

* fix: 更改代码写法,修复错误

临时修复react-devtools在插件开发模式下报错问题;PR中根据代码建议调整写法

#11438

* Revert "fix(react): 修复小程序插件无法使用hooks问题"

This reverts commit dc93f9a.

# Conflicts:
#	packages/taro-loader/src/native-component.ts

* chore: update plugin example

* fix(react): 修复小程序插件无法使用 Taro hooks 的问题,fix #11373

* fix(loader): 修复编译小程序插件时配合使用 devtools 插件会报错的问题,fix #11438

* fix: ci

Co-authored-by: chenjiajian <798095202@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React V-3 Version - 3.x
Projects
None yet
2 participants