react-native icon indicating copy to clipboard operation
react-native copied to clipboard

'Reload' did not change when I modified a js file

Open hyvenzhu opened this issue 10 years ago • 20 comments

0.28.0 does not work while 0.27.0 works well. When I init a React-Native project, after change a js file, reload does not work well

hyvenzhu avatar Jun 28 '16 03:06 hyvenzhu

same as me

Chanasit avatar Jun 28 '16 10:06 Chanasit

Can you provide more information on what exactly not working? Live reload? HMR?

satya164 avatar Jun 28 '16 10:06 satya164

@satya164 'Reload JS', there is no error happened on the terminal

hyvenzhu avatar Jun 29 '16 03:06 hyvenzhu

I confirm this as well. I've tried previous fixes before (restarting the server, resetting the cache), but it still doesn't react to file changes.

Another thing noticed is the rather long time for the sever to start: [6:09:42 AM] Building Dependency Graph . . . [6:15:41 AM] find dependencies (31143ms)

Besides that, the node js process hogs all the processor while starting the server. I noticed that because my computer started simulating coffee grinding :) while the packager was crawling the file system.

shtefanntz avatar Jun 29 '16 03:06 shtefanntz

@hiphonezhu: Are you definitely enabling "Live Reload" in the simulator? The "Live Reload" setting is set and persisted for each app. If you build a new app it will default to not having it enabled. Can you verify that setting? You didn't mention if you were performing this step or not.

dsibiski avatar Jun 30 '16 00:06 dsibiski

@dsibiski I am sure that I do not enabling "Live Reload", just 'reload js'

hyvenzhu avatar Jun 30 '16 01:06 hyvenzhu

I have the same problem whether enable "Live Reload" or "Hot Reloading", or both of them.

jude-liu avatar Jun 30 '16 08:06 jude-liu

I reloaded not changing. same!!

gapgag55 avatar Jul 02 '16 05:07 gapgag55

@satya164, I believe this is the same as #8635

arthurxavierx avatar Jul 08 '16 12:07 arthurxavierx

Still reproducing in RN 0.29 :(

shtefanntz avatar Jul 10 '16 13:07 shtefanntz

Apparently, the fix isn't related to RN. I followed the instructions from @InnerPeace080 in #7257 and everything works as before

shtefanntz avatar Jul 10 '16 14:07 shtefanntz

+1

xiDaiDai avatar Jul 12 '16 07:07 xiDaiDai

+1,thanks

micsay avatar Jul 12 '16 14:07 micsay

anyone solution? i have the same issue on 0.30 to 0.32

vzhen avatar Aug 28 '16 04:08 vzhen

Same issue on 0.32 on iOS device. On Android device is working.

Reload js is not refreshing the js code and also the hot reload and live reload options are not appearing.

guilhermebruzzi avatar Sep 02 '16 21:09 guilhermebruzzi

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.

togayther avatar Sep 03 '16 04:09 togayther

I also have exactly the same problem on v0.32: "the hot reload and live reload options are not appearing."

@togayther Does your solution solve this problem too?

afilp avatar Sep 06 '16 22:09 afilp

yes, its work for me. @af7

togayther avatar Sep 07 '16 00:09 togayther

We only support HMR for React components, with all the limitations of https://github.com/gaearon/react-transform-hmr#readme

davidaurelio avatar Sep 16 '16 17:09 davidaurelio

i have same issue please give me solution

omhybrid avatar Nov 12 '16 13:11 omhybrid