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

Packager does not see changes to files. Reload does not work.

Open lernerbot opened this issue 11 years ago • 50 comments

When I first started my project, reloading without recompiling worked. Somewhere along the way I broke this.

When I run the project from Xcode, the packager terminal window opens fine but it doesn't see the changes I'm making to the JS files. I'm using Atom as my editor.

This is as far as it gets: React packager ready.

[11:06:24 AM] Crawling File System (7704ms) [11:06:24 AM] Building in-memory fs for JavaScript [11:06:26 AM] Building in-memory fs for JavaScript (2430ms) [11:06:26 AM] Building Haste Map [11:06:28 AM] Building Haste Map (2290ms) [11:06:28 AM] Building Dependency Graph (12430ms)

I've tried uninstalling watchman. Updating and upgrading homebrew. Killing the process and restarting. Rebooting computer. Nothing seems to get it back to the old way.

lernerbot avatar Nov 25 '15 19:11 lernerbot

Hey lernerbot, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If this is a feature request or a bug that you would like to be fixed by the team, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • We welcome clear issues and PRs that are ready for in-depth discussion; thank you for your contributions!

facebook-github-bot avatar Nov 25 '15 19:11 facebook-github-bot

@lernerbot Is the app loading? I don't see a network request for the bundle in your terminal output.

StackOverflow and Discord #react-native channel is the best way to get help on issues like this.

chirag04 avatar Nov 25 '15 19:11 chirag04

Yes, the app is loading if I run it from Xcode. Sometimes I have to wait up to 10 seconds after saving the file for the changes to be seen.

This is the full output:

┌────────────────────────────────────────────────────────────────────────────┐ │ Running packager on port 8081. │ │ │ │ Keep this packager running while developing on any JS projects. Feel │ │ free to close this tab and run your own packager instance if you │ │ prefer. │ │ │ │ https://github.com/facebook/react-native │ │ │ └────────────────────────────────────────────────────────────────────────────┘ Looking for JS files in /Users/lernerbot/reactnative/BeaconMobile

[11:06:16 AM] Building Dependency Graph [11:06:16 AM] Crawling File System [11:06:16 AM] Loading bundles layout [11:06:16 AM] Loading bundles layout (1ms)

React packager ready.

[11:06:24 AM] Crawling File System (7704ms) [11:06:24 AM] Building in-memory fs for JavaScript [11:06:26 AM] Building in-memory fs for JavaScript (2430ms) [11:06:26 AM] Building Haste Map [11:06:28 AM] Building Haste Map (2290ms) [11:06:28 AM] Building Dependency Graph (12430ms)

lernerbot avatar Nov 25 '15 19:11 lernerbot

I had the same problem. All of a sudden the packager stopped bundling when I changed files. This had been working for months without problems.

What I discovered was that my .git/ directory had an index.lock file. Once I deleted that file, the automatic re-bundling started working again.

thomasvm avatar Nov 30 '15 08:11 thomasvm

I'm getting crazy with this, both react-native start and react-native bundle seem to be stuck on an old version of my code that doesn't exist anywhere anymore! Cleaning, deleting, re-cloning my repo didn't help...

[edit] rebooting my computer seemed to do the trick...

cosmith avatar Dec 10 '15 14:12 cosmith

I'm getting this too. It seems to be a watchman bug perhaps, since running

  • watchman watch-del-all

and then reloading works after. I'm on watchman 4.3.0 -- what version is everyone else using?

pcottle avatar Dec 27 '15 01:12 pcottle

Hrm, downgrading to watchman 4.1.0 seems to have helped the issue.

pcottle avatar Dec 27 '15 02:12 pcottle

For me, it helped to start react-native bundle with the option --verbose, get the cache directory out of the log (for me, its /var/folders/jf/j39xsb090795rm8l98qjdff80000gn/T/) and do a rm react-packager* in there. After that, it's using the latest version of the files again.

PhilippKrone avatar Jan 02 '16 13:01 PhilippKrone

I ran into this same problem with watchman 3.9.0

respectTheCode avatar Jan 13 '16 20:01 respectTheCode

Given this issue seems connected to many different situations and problems, and the fact that watchman has progressed, we're closing this issue in favor of more reproducible examples.

If you run into this, please try removing the packager cache as mentioned above, or the watchman watch-del-all command before submitting another issue. Thanks!

jsierles avatar Mar 20 '16 19:03 jsierles

I am having the same issue of Packager on windows. It is too slow while performing the initial tasks( probably have to wait for 5-10 mins to get ready for request).

After some modification to .js file ut does not reloads the app not even hot reloading.

Enabling the Live reload / Hot reloading also doesn't works.

Updated node to 6.2.0 and npm v 3.8.9 But all the deps were installed via Node 4.4.5

After updating the node but still file changes are not detected and packager serves the old app bundle on every request.

Thanks!

hirenchauhan2 avatar Jul 04 '16 10:07 hirenchauhan2

Yep. Having the same problem as Harry008.

anraiki avatar Jul 06 '16 07:07 anraiki

also have the same problem, in windows. the packager is serving old files and i dont know where the cache is ...

yooneskh avatar Jul 15 '16 14:07 yooneskh

i found a fix by using a new package watcher

On Jul 15, 2016 7:27 AM, "YoonesKh" [email protected] wrote:

also have the same problem, in windows. the packager is serving old files and i dont know where the cache is ...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/4357#issuecomment-232965368, or mute the thread https://github.com/notifications/unsubscribe-auth/AD0wdEaOrMNEfn8Kpt5RNp04_BNO2TWrks5qV5jPgaJpZM4Gpd6i .

anraiki avatar Jul 15 '16 15:07 anraiki

@anraiki can you please explain?

yooneskh avatar Jul 15 '16 15:07 yooneskh

I opt for a solution by replacing their new "watching" packager. It's in alpha sadly, but apparently it fixed my problem.

https://github.com/facebook/watchman/issues/19

It doesn't hurt to try it.

On 7/15/2016 8:25 AM, YoonesKh wrote:

@anraiki https://github.com/anraiki can you please explain?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/4357#issuecomment-232983004, or mute the thread https://github.com/notifications/unsubscribe-auth/AD0wdJm2aMi4Bgaolz2N1jNLcK455Bj3ks5qV6ZugaJpZM4Gpd6i.

anraiki avatar Jul 15 '16 16:07 anraiki

@anraiki it fixed my problem too. thank yoo.

yooneskh avatar Jul 20 '16 13:07 yooneskh

@anraiki @yooneskh How to replace watchman ? same issue.

"react": "15.2.1",
"react-native": "0.30.0",

OS: windows7

I download the new watchman, add it to PATH and
(current path is E:\temp2\RouterTest)

  1. watchman watch-del-all
  2. watchman watch E:\temp2\RouterTest
  3. react-native start
  4. reload js on genymotion I get error index.android.js not found. then I change some lines in index.android.js and reload js again. I get this error in terminal
[23:06:27] <END>   find dependencies (2354ms)
Error: Unable to find file with path: E:\temp2\RouterTest\node_modules\react-nat
ive\packager\react-packager\src\Resolver\polyfills\prelude.js
    at Fastfs.readFile (E:\temp2\RouterTest\node_modules\react-native\node_modul
es\node-haste\lib\fastfs.js:141:15)
    at E:\temp2\RouterTest\node_modules\react-native\node_modules\node-haste\lib
\Module.js:168:49
    at Cache.get (E:\temp2\RouterTest\node_modules\react-native\node_modules\nod
e-haste\lib\Cache\index.js:64:103)
    at Polyfill.read (E:\temp2\RouterTest\node_modules\react-native\node_modules
\node-haste\lib\Module.js:167:26)
    at Bundler._toModuleTransport (index.js:549:14)
    at module._toModuleTransport.then (index.js:394:14)
    at Array.map (native)
    at index.js:411:48
    at tryCallOne (E:\temp2\RouterTest\node_modules\react-native\node_modules\pr
omise\lib\core.js:37:12)
    at E:\temp2\RouterTest\node_modules\react-native\node_modules\promise\lib\co
re.js:123:15

new-xd avatar Jul 28 '16 15:07 new-xd

watch out for any watchman that node or chocolatey or anything else might have installed

On Thu, Jul 28, 2016, 20:07 New [email protected] wrote:

@anraiki https://github.com/anraiki @yooneskh https://github.com/yooneskh How to replace watchman ? same issue.

"react": "15.2.1", "react-native": "0.30.0",

OS: windows7

I download the new watchman, add it to PATH and

(current path is E:\temp2\RouterTest)

  1. watchman watch-del-all
  2. watchman watch E:\temp2\RouterTest
  3. react-native start
  4. reload js on genymotion I get error index.android.js not found. then I change some lines in index.android.js and reload js again. I get this error in terminal

[23:06:27] find dependencies (2354ms) Error: Unable to find file with path: E:\temp2\RouterTest\node_modules\react-nat ive\packager\react-packager\src\Resolver\polyfills\prelude.js at Fastfs.readFile (E:\temp2\RouterTest\node_modules\react-native\node_modul es\node-haste\lib\fastfs.js:141:15) at E:\temp2\RouterTest\node_modules\react-native\node_modules\node-haste\lib \Module.js:168:49 at Cache.get (E:\temp2\RouterTest\node_modules\react-native\node_modules\nod e-haste\lib\Cache\index.js:64:103) at Polyfill.read (E:\temp2\RouterTest\node_modules\react-native\node_modules \node-haste\lib\Module.js:167:26) at Bundler._toModuleTransport (index.js:549:14) at module._toModuleTransport.then (index.js:394:14) at Array.map (native) at index.js:411:48 at tryCallOne (E:\temp2\RouterTest\node_modules\react-native\node_modules\pr omise\lib\core.js:37:12) at E:\temp2\RouterTest\node_modules\react-native\node_modules\promise\lib\co re.js:123:15

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/4357#issuecomment-235932927, or mute the thread https://github.com/notifications/unsubscribe-auth/AKFfVeK1QtVB3CJnavy2M6YVeSGVSEH6ks5qaMyggaJpZM4Gpd6i .

yooneskh avatar Aug 01 '16 14:08 yooneskh

I'm having the same problem here. Can anyone help me out? It appears that my packager is not bundling it. Everytime I make changes and do Cmd+R, it blinks the screen but not loading any changes.

Xcode 7.3 Watchman 4.6 React Native 0.30

k0mikus avatar Aug 05 '16 04:08 k0mikus