Skip to content

[Android][0.24.1][Windows] packager not update when change js file content #7257

@InnerPeace080

Description

@InnerPeace080
Contributor

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.

Activity

radko93

radko93 commented on Apr 27, 2016

@radko93
Contributor

Have you tried restarting you packager/emulator/computer? Maybe check this issue: #306. Look at watchman, auto-saving.

InnerPeace080

InnerPeace080 commented on Apr 28, 2016

@InnerPeace080
ContributorAuthor

restart packager , computer have no effect. i have no idea with this

taxusyew

taxusyew commented on Apr 28, 2016

@taxusyew

+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] request:/index.android.bundle?platform=android&dev=true&hot=t
rue&minify=false
[11:52:39] find dependencies
[11:56:49] Crawling File System (261278ms)
[11:56:49] Building in-memory fs for JavaScript
[11:56:51] Building in-memory fs for JavaScript (1743ms)
[11:56:51] Building in-memory fs for Assets
[11:56:52] Building in-memory fs for Assets (1166ms)
[11:56:52] Building Haste Map
[11:56:53] Building (deprecated) Asset Map
[11:56:53] Building (deprecated) Asset Map (307ms)
[11:56:53] Building Haste Map (758ms)
[11:56:53] Building Dependency Graph (264980ms)
transformed 528/528 (100%)
[11:56:59] find dependencies (260047ms)
[11:56:59] request:/index.android.bundle?platform=android&dev=true&hot=t
rue&minify=false (260291ms)
[Hot Module Replacement] Client connected

InnerPeace080

InnerPeace080 commented on Apr 28, 2016

@InnerPeace080
ContributorAuthor

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

tahaziadeh

tahaziadeh commented on May 27, 2016

@tahaziadeh

great solution InnerPeace080:+1:

shtefanntz

shtefanntz commented on Jul 10, 2016

@shtefanntz
Contributor

Thanks a lot, PeaceFromInside080 !!! ^_^

xiDaiDai

xiDaiDai commented on Jul 12, 2016

@xiDaiDai

How to deal with Windows Platform?
"\node-haste\lib\FileWatcher\index.js" how can I get this file ?install watchman?

xiDaiDai

xiDaiDai commented on Jul 12, 2016

@xiDaiDai

finally got the file path :\node_modules\react-native\node_modules\node-haste

micsay

micsay commented on Jul 12, 2016

@micsay

thanks

togayther

togayther commented on Jul 23, 2016

@togayther

thanks, that's work.

nishil-tamboli

nishil-tamboli commented on Sep 3, 2016

@nishil-tamboli

I was stuck with this one for hours. @InnerPeace080 your solution saved my life! Amazing! :)

TranTungVGroup

TranTungVGroup commented on Sep 10, 2016

@TranTungVGroup

You saved my day. Your solution works perfect. Thank you so much !!!!

26 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @taxusyew@cirojr@shtefanntz@lowdev@InnerPeace080

        Issue actions

          [Android][0.24.1][Windows] packager not update when change js file content · Issue #7257 · facebook/react-native