Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react native debugger not recognizing new file additions

Tags:

react-native

React Native debugger (Chrome dev tools) was working fine for months, but now when I add a new file it doesn't show it in the "Sources" tab. When I edit code in existing files it recognizes it, however when I add a file it does not.

Any ideas?

Edit

I've realized it can be nothing to do with the particular app. I created brand new app with init command and problem still exists.

I also upgraded RN from 0.55.4 to 0.59.5. This didn't make a difference, still seeing same issue.

Also reinstalled Chrome, no luck.

Also reinstalled NPM in case was linked to packager....nope!

$30 Canadian dollars will be gladly given to whoever can solve this

Edit 7/13/2019

Increased value to $50 for whoever can solve this.
Im totally in shock this is something that the best tech minds in the world cant solve lol (but not lol)

like image 525
james murphy Avatar asked Jun 19 '19 01:06

james murphy


Video Answer


1 Answers

OMG that was 4 weeks of hell for such a rookie mistake!!

Turns out if you create a file (e.g. a component) but don't import it into another file and use it.....the file won't register in chrome dev tools Sources.

What happened with me was that the code in my file had errors the first time I built it....and because of this, it wasn't being used in app and thus wasn't showing in Sources. I was thinking "how am I supposed to debug if I cant even see the file in Sources?".

Guess the answer is to make sure that when you create a new file, you build it right away when the code is simple....then chrome will recognize the file and you can debug. If you write a whole bunch of code then build and it fails you won't be able to debug.

like image 109
james murphy Avatar answered Nov 15 '22 08:11

james murphy