[Android][0.24.1][Windows] packager not update when change js file content
after i update react native to 0.24.1, I modify javascript code and save but packager server not detect this change. So reload js from my android have no effect.
anybody has some advance, thank very much.
Have you tried restarting you packager/emulator/computer? Maybe check this issue: https://github.com/facebook/react-native/issues/306. Look at watchman, auto-saving.
restart packager , computer have no effect. i have no idea with this
+1, I got the same problem, live load and hot load both not working. The js file only transformed once when I start the packager. It also toke so long time to finish. here is the log :
[11:52:39]
at last . I found problem.
problem still is timeout . but when timeout it not show message for us (still don't know why.).
to solve this problem.
in file "\node_modules\node-haste\lib\FileWatcher\index.js" you should increase "MAX_WAIT_TIME" variable (example : 360000) ;
and change function "_createWatcher" from
key: '_createWatcher',
value: function _createWatcher(rootConfig) {
var watcher = new WatcherClass(rootConfig.dir, {
glob: rootConfig.globs,
dot: false
});
return new Promise(function (resolve, reject) {
var rejectTimeout = setTimeout(function () {
return reject(new Error(timeoutMessage(WatcherClass)));
}, MAX_WAIT_TIME);
watcher.once('ready', function () {
clearTimeout(rejectTimeout);
resolve(watcher);
});
});
}
to
key: '_createWatcher',
value: function _createWatcher(rootConfig) {
var watcher = new WatcherClass(rootConfig.dir, {
glob: rootConfig.globs,
dot: false
});
return new Promise(function (resolve, reject) {
const rejectTimeout = setTimeout(function() {
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', function () {
clearTimeout(rejectTimeout);
resolve(watcher);
});
});
}
now . every thing run normal . :D
great solution InnerPeace080:+1:
Thanks a lot, PeaceFromInside080 !!! ^_^
How to deal with Windows Platform? "\node-haste\lib\FileWatcher\index.js" how can I get this file ?install watchman?
finally got the file path :\node_modules\react-native\node_modules\node-haste
thanks
thanks, that's work.
I was stuck with this one for hours. @InnerPeace080 your solution saved my life! Amazing! :)
You saved my day. Your solution works perfect. Thank you so much !!!!
For the benefit of future Googlers, MAX_WAIT_TIME is located here :
\node_modules\react-native\packager\react-packager\src\node-haste\FileWatcher\
Thank you very much @InnerPeace080! I was stucked in this for hours!
Thank you all From the bottom of Stavro's heart!
thanks!
update node.js to 6.x may works
Thank you @InnerPeace080 . On my windows system file path was :node_modules\react-native\packager\react-packager\src\node-haste\Filewatcher.
This not good. The code is now like this. Error come up when I do replace
`_createWatcher(rootConfig) { const watcher = new WatcherClass(rootConfig.dir, { glob: rootConfig.globs, dot: false, });
return new Promise((resolve, reject) => {
const rejectTimeout = setTimeout(
() => reject(new Error(timeoutMessage(WatcherClass))),
MAX_WAIT_TIME
);
watcher.once('ready', () => {
clearTimeout(rejectTimeout);
resolve(watcher);
});
});
}`
Niccee!!!! Thank You !!!!