Runtime error after upgrade to React Native 0.61 - "TypeError: hmrClient.send is not a function"
See original GitHub issueI am in the process of updating an existing project from react-native 0.60.4
to 0.61.2
. The app is successfully packaged and installs on my local iOS Simulator. The Metro Bundler successfully serves the app to the device. My observations are as follows:
- Upon running, a red screen error headlined
TypeError: hmrClient.send is not a function.
is displayed on every launch, regardless of whetherFast Refresh
is enabled or disabled. - This red screen message can be dismissed, and underneath I have a functional, navigable application.
- No Fast Refresh functionality works when enabled, most likely tied directly to this.
React Native version:
yarn run v1.19.1
$ /Users/alex/Development/<project>/node_modules/.bin/react-native info
info Fetching system and libraries information...
System:
OS: macOS 10.15
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
Memory: 141.59 MB / 16.00 GB
Shell: 3.0.2 - /usr/local/bin/fish
Binaries:
Node: 10.16.3 - /var/folders/t_/q6_rnx915r38lst_z95l6swh0000gn/T/yarn--1571762447670-0.2398560026433516/node
Yarn: 1.19.1 - /var/folders/t_/q6_rnx915r38lst_z95l6swh0000gn/T/yarn--1571762447670-0.2398560026433516/yarn
npm: 6.11.3 - ~/.config/nvm/10.16.3/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5900203
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
Done in 7.47s.
Error output
TypeError: hmrClient.send is not a function. (In 'hmrClient.send(JSON.stringify({
type: 'log-opt-in'
}))', 'hmrClient.send' is undefined)
enable
HMRClient.js:70:19
setup
HMRClient.js:241:6
callFunctionReturnFlushedQueue
[native code]:0
Other notes
Interestingly, this isn’t caught by this preceding invariant
statement in the enable
or disable
members of HMRClient
. I suspect it’s related to some misalignment within HMRClient.js
or any corresponding native code.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:18
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Runtime TypeError: hmrClient.send is not a function
I updated react-native-fs to 2.16.2 ( 2.16.x is recommended for RN 0.60+ ) and the error disappeared. Also I made sure in package....
Read more >How to Upgrade to React 18
In this post, we will guide you through the steps for upgrading to React 18. Please report any issues you encounter while upgrading...
Read more >react-native-codegen | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >Upgrading to new versions - React Native
The upgrade command works on top of Git by using git apply with 3-way merge, therefore it's required to use Git in order...
Read more >error typeerror: labels.slice is not a function - You.com | The AI ...
chart.js expects the labels property to be an array. But your labels is a Set object, which can't use slice . One way...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks all! Got back to this today and can confirm that for me this was caused by a project-level dependency on
metro-config@^0.55.0
. Since this is a caret range match which treats0.56.0
as incompatible, this meant that I still had0.55.0
installed local to the project. I then have a Yarn Workspaces setup which meant this version was selected by the Metro Bundler. Closing the issue as this is therefore a project configuration problem and not a bug in React Native.This worked for me…Thanks a lot 👍