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

Hot Reloading is Enabled but no changes made #88

Closed
adhywiranata opened this issue Mar 18, 2017 · 10 comments
Closed

Hot Reloading is Enabled but no changes made #88

adhywiranata opened this issue Mar 18, 2017 · 10 comments

Comments

@adhywiranata
Copy link

When I saved my script, hot reload is enabled and the "Hot Loading..." tooltip shows up but no changes made. Also noticed that Bundling node_modules/react-native-scripts/build/bin/crna-entry.js is not logged when I did this.

Hot reloading works perfectly with my other react-native projects (created using the react-native init), so currently assuming that this is an expo-related issue.

@anp
Copy link
Contributor

anp commented Mar 18, 2017

Do you have both hot module replacement and live reloading enabled? CRNA apps have live reloading enabled by default, and turning on HMR will often break both for that packager session.

@adhywiranata
Copy link
Author

Yeah, I saw the expo documentation said that Live Reload and Hot Module Reloading should not be both enabled. I tried disabling the HMR and enabling the Live Reload and it works just fine. But if I switched them (HMR enabled, Live Reload disabled), no changes are made.

What makes these strange is that somehow the HMR works when I intentionally break the app to show the error screen, but no changes when I change the app's component styles/states.

@kristojorg
Copy link

kristojorg commented Apr 8, 2017

Also seeing this behavior in CRNA with live reloading disabled hot reloading enabled and a fresh packager session.

EDIT: I am not seeing a tooltip for hot reload and the packager is not rebuilding or detecting any changes.

EDIT 2: this appears to be related to : facebook/react-native#10991

EDIT 3: I have solved this by making my root component a class (instead of stateless functional component), which appears to solve the issue for all components beneath it.

@adhywiranata
Copy link
Author

adhywiranata commented Apr 12, 2017

Thanks @kristojorg this solved my problem. Apparently we have to have a class as the root component, and all children components can be hot-reloaded. Thanks!

@slorber
Copy link

slorber commented Jun 9, 2017

Hi,

I'd like this to be reopened because I've made my first component a class and it does not solve the hot reload for nested components. imho. As long as you have one functional component in the tree it seems to prevent deeply nested classes to hot reload, which makes it barely unusable currently.

@samassango
Copy link

Hi

I am experiencing this issue which is causing the app to crush

Bundling node_modules\react-native-scripts\build\bin\crna-entry.js
No module changed.
I tried to reinstall the react-native-scripts but still no difference

@martianmartian
Copy link

still having this issue here. iphone 5.. can't even get through the tutorial because of this problem

@brentvatne
Copy link
Member

@samassango @martianmartian - please try installing watchman: https://facebook.github.io/watchman/

@renatobenks-zz
Copy link

renatobenks-zz commented Sep 10, 2017

@kristojorg hey, your resolve fix it to me, but I'm still confusing about this, because before I didn't need a root component like class component, my root component was a normal functional component and the hot reloading was working very well, so after some changes don't works anymore, until now, with class component on root.

Ps.: seems to me that watchman is not loading the code changes but my modules are re-loading, and how I explain, before I could see the watchman log to HMR re-loading modules

@exhesham
Copy link

exhesham commented Dec 6, 2017

Same issue here, however, I found some temporary workarounds to avoid wasting time on that. elaborated here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants