【问题标题】:Facebook React Native Hot Reload not working ( Ubuntu 14.04 )Facebook React Native Hot Reload 不起作用(Ubuntu 14.04)
【发布时间】:2016-11-08 20:31:12
【问题描述】:

目标:

我正在尝试让热重载工作,我在代码库中进行了更改,并且更改出现在 android 模拟器中,如广告所示。

问题:

它不起作用,我感觉它与 facebook watchman 有关。每次我对代码库进行更改时,react-native 服务器都会说

[sane] Warning: Lost connection to watchman, reconnecting..
[sane] Warning: Lost connection to watchman, reconnecting..
[sane] Warning: Lost connection to watchman, reconnecting..
etc....

顺便说一句:是的,我从 android 模拟器的开发者菜单中启用了热重载


操作系统:

Ubuntu 14.04.5 LTS

守望者:

watchman watch-list
{
    "version": "4.7.0",
    "roots": [
        "/home/andey/Downloads/wyse"
    ]
}

反应原生:

react-native -v
react-native-cli: 1.2.0
react-native: 0.36.1


andey@work:~/Downloads/wyse$ react-native start
(node:9646) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
(node:9646) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
Scanning 709 folders for symlinks in /home/andey/Downloads/wyse/node_modules (7ms)
 ┌────────────────────────────────────────────────────────────────────────────┐ 
 │  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
   /home/andey/Downloads/wyse 

[Hot Module Replacement] Server listening on /hot

React packager ready.

[11/8/2016, 3:21:54 PM] <START> Initializing Packager
[11/8/2016, 3:21:54 PM] <START> Building in-memory fs for JavaScript
[11/8/2016, 3:21:54 PM] <END>   Building in-memory fs for JavaScript (133ms)
[11/8/2016, 3:21:54 PM] <START> Building Haste Map
[11/8/2016, 3:21:54 PM] <END>   Building Haste Map (94ms)
[11/8/2016, 3:21:54 PM] <END>   Initializing Packager (295ms)
[sane] Warning: Lost connection to watchman, reconnecting..
[sane] Warning: Lost connection to watchman, reconnecting..
[11/8/2016, 3:22:19 PM] <START> Requesting bundle: {"url":"/index.android.bundle?platform=android&dev=true&hot=true&minify=false"}
[11/8/2016, 3:22:19 PM] <START> Transforming modules
transformed 641/641 (100%)
[11/8/2016, 3:22:20 PM] <END>   Transforming modules (1047ms)
[11/8/2016, 3:22:20 PM] <END>   Requesting bundle: {"url":"/index.android.bundle?platform=android&dev=true&hot=true&minify=false"} (1173ms)
[Hot Module Replacement] Client connected
[sane] Warning: Lost connection to watchman, reconnecting..
[sane] Warning: Lost connection to watchman, reconnecting..
[sane] Warning: Lost connection to watchman, reconnecting..
[sane] Warning: Lost connection to watchman, reconnecting..

【问题讨论】:

    标签: react-native watchman


    【解决方案1】:

    我从我的系统中完全卸载了watchman,并且热重载开始工作。这是一个巧合,我不确定,但它现在正在工作。

    【讨论】:

      猜你喜欢
      • 2018-09-04
      • 2019-02-02
      • 2018-10-15
      • 2021-04-03
      • 1970-01-01
      • 2018-09-08
      • 1970-01-01
      • 1970-01-01
      • 2015-11-10
      相关资源
      最近更新 更多