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

React Packager not reloading #8784

Closed
yooneskh opened this issue Jul 14, 2016 · 13 comments
Closed

React Packager not reloading #8784

yooneskh opened this issue Jul 14, 2016 · 13 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@yooneskh
Copy link

I am developing on windows (8.1) and am using genymotion (2.7.2 and Nexus 5 device with android 4) for simulator.

The problem is that i cannot get the reload to work. i have done the adb reverse tcp:8081 tcp:8081 .

The only way to get the new files to be seen is to do another react-native run-android .

Any help?

@st0ffern
Copy link

st0ffern commented Jul 14, 2016

@yooneskh

Android: ctrl+m inside AVD
Click Reload

Read specs: http://facebook.github.io/react-native/releases/0.29/docs/debugging.html#reloading-javascript

This is not a issue with react-native, so please go to Stackoverflow or read docs :)
Issue can be closed.

@yooneskh
Copy link
Author

@Stoffern i already know this. I go to genymotion, open the so called menu, hit the reload and nothing happens.

@yooneskh
Copy link
Author

To clarify even more, these actions complete successfully

  • i run the app in the emulator
  • open the menu
  • select "enable hot reload"
  • React Packager shows some messages about transforming some things and such
  • the app fetches js bundle, flashes and things go back to where they were

but my changed files are not there.

since the app and React Packager seem to successfully talk with each other, i guess React Packager just does not see the changes.

@malaman
Copy link

malaman commented Jul 15, 2016

@yooneskh .
Try watchman watch-del-all and restart packager.

@StellwagJo
Copy link

Having same issues here. Worked with react-native 0.23 & 0.27. Hot reloading always worked as expected.
Since my upgrade on 0.29.1 (stable) the hotreloading doesn't reload the code.

@psrustik
Copy link

psrustik commented Jul 19, 2016

I have same issue on react native 0.28 and windows 10

upd: increasing constant MAX_WAIT_TIME in file "\node_modules\node-haste\lib\FileWatcher\index.js" helped me. (from this recipe #7257 (comment) )

@vzhen
Copy link

vzhen commented Aug 28, 2016

exactly same issue on Windows 7
Work fine on 0.28 but problem in 0.30 and 31, 32

@yooneskh you found any solution?

@togayther
Copy link

same issue on android device with react-native 0.32.

finally, i found method to solve this problem.

in file "react-native\packager\react-packager\src\node-haste\FileWatcher\index.js"
you can increase "MAX_WAIT_TIME" variable. such: 360000.

and change function "_createWatcher"

to

_createWatcher(rootConfig) {
    const watcher = new WatcherClass(rootConfig.dir, {
      glob: rootConfig.globs,
      dot: false,
    });

    return new Promise((resolve, reject) => {
      const rejectTimeout = setTimeout(
        () => reject(new Error([
            'Watcher took too long to load',
            'Try running `watchman version` from your terminal',
            'https://facebook.github.io/watchman/docs/troubleshooting.html',
          ].join('\n'))),
        MAX_WAIT_TIME
      );

      watcher.once('ready', () => {
        clearTimeout(rejectTimeout);
        resolve(watcher);
      });
    });
  }

that's all and work for me.

@sebahattint
Copy link

I also had the same problem. Working now. Thanks guys!
react-native: 0.32.0
react-native-cli: 1.0.0
OS: Windows 10

@Brokray
Copy link

Brokray commented Sep 19, 2016

Had the same issue, @togayther's solution fixed it. Thanks :)
react-native: 0.30.0
OS: Windows 10

@TrustDec
Copy link

TrustDec commented Oct 8, 2016

I found the directory is wrong, according to the previous method, version 0.34 is supposed to be in the directory, but after I changed or not, have not had any effect
The question has bothered me for two days.
I also had the same problem.For help Thanks guys!
react native 0.33/0.34
OS:Windows 10

@Neungzad
Copy link

+1 , I also had the same problem.

@aljux
Copy link

aljux commented Nov 3, 2016

I still have this problem even with @togayther's fix.
react-native-cli: 1.0.0
react-native: 0.36.0
macOS 10.12.1

brentvatne pushed a commit to expo/react-native that referenced this issue Nov 5, 2016
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes facebook#8784 facebook#7257
Closes facebook#10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
terribleben pushed a commit to expo/react-native that referenced this issue Nov 7, 2016
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes facebook#8784 facebook#7257
Closes facebook#10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
ide pushed a commit to expo/react-native that referenced this issue Nov 23, 2016
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes facebook#8784 facebook#7257
Closes facebook#10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
ide pushed a commit to expo/react-native that referenced this issue Nov 23, 2016
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes facebook#8784 facebook#7257
Closes facebook#10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
ide pushed a commit to expo/react-native that referenced this issue Nov 30, 2016
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes facebook#8784 facebook#7257
Closes facebook#10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
DanielMSchmidt pushed a commit to DanielMSchmidt/react-native that referenced this issue Jan 4, 2017
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes facebook#8784 facebook#7257
Closes facebook#10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
cpojer pushed a commit to facebook/metro that referenced this issue Jan 26, 2017
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes facebook/react-native#8784 facebook/react-native#7257
Closes facebook/react-native#10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.