node.jsreact-nativeversionmetro-bundler

React Native not doing Hot Reload


This is not a question, more of info to bug i had and how it was solved.

Bug found on Mac OS.

Repro steps:

Versions:


Solution

  • SO, previous project i worked on got some spec requirements for node version, so i had to set global node version to 14, new project however require version Node 18.

    I run project with console that set to 18 using nvm use 18, but it was not solution, it was an actual reason for bug.

    After remember i had to switch global version solution was easy:

    nvm alias default 18
    

    Make sure to reinstall packages and pods

    yarn
    cd ios && pod deintegrate && pod install && cd ..
    

    After this rerun project using same npx react-native start --reset-cache got me required result, after restart metro started to recognise connected device, reload using R also works.

    What happened from my understanding might be caused because console it self had version 18, but it seems like it was not affecting full environment and metro under the hood was using global version that cause differences in where it's being built and where metro listening and search for device.

    Be patient to your environement versions, and hope it might help someone who as sleepy as me.