question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Runtime error after upgrade to React Native 0.61 - "TypeError: hmrClient.send is not a function"

See original GitHub issue

I 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 whether Fast 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

Simulator Screen Shot - iPhone 11 Pro - 2019-10-22 at 17 39 19

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.

https://github.com/facebook/react-native/blob/10f55e752d1b3e1fd9b993a72c692750118f0608/Libraries/Utilities/HMRClient.js#L67-L72

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
huntiecommented, Nov 26, 2019

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 treats 0.56.0 as incompatible, this meant that I still had 0.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.

5reactions
IbrahimSulaicommented, Dec 23, 2020

I had the same issue with a React Native app, initialised without the use of expo. ‘hrmClient.send is not a function’ displayed every time I build/refreshed my app and fast refresh was not working.

This fixed my problem: yarn add metro@0.56.0

from: https://www.gitmemory.com/issue/react-native-community/releases/140/530142204

This worked for me…Thanks a lot 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found