Skip to content

Dev troubleshooting

Vitaliy Vlasov edited this page May 28, 2018 · 37 revisions

Initial setup issues

npm install hangs

Downgrade to version 5.5.1: npm install -g [email protected].

react-native package missing

npm install does not install react-native, this has to be installed manually.

re-natal package missing

re-natal also has to be installed manually.

enable-source-maps complains about missing metro-bundler

./re-natal enable-source-maps complains about missing metro-bundler, so it again has to be installed manually. This deletes node_modules/metro and adds node_modules/metro-bundler Note that afterwards re-natal package is gone, so again npm install re-natal.

Metro Bundler complaining about duplicate files

error: bundling failed: ambiguous resolution: module `/path-to-status-react/node_modules/react-native/Libraries/react-native/react-native-implementation.js` tries to require `Button`, but there are several files providing this module. You can delete or fix them:

  * `/path-to-status-react/node_modules/react-native/Libraries/Components/Button.desktop.js`
  * `/path-to-status-react/node_modules/react-native/Libraries/Components/Button.js`

This means that Metro Bundler's defaults.js does not list desktop as a supported platform.

react-native run desktop complaining about missing qmldir:

Error copying directory from "/path-to-status-react/node_modules/react-native/ReactQt/runtime/src/qmldir" to "/path-to-status-react/desktop/lib/React".
make[2]: *** [lib/CMakeFiles/copy-qmldir] Error 1
make[1]: *** [lib/CMakeFiles/copy-qmldir.dir/all] Error 2
make: *** [all] Error 2

Can be solved by re-running npm install react-native which put the ReactQt/runtime/src/qmldir file back.

react-native run-desktop complaining about missing libstatus.h:

Command failed: ./build.sh -e "node_modules/react-native-i18n/desktop;node_modules/react-native-config/desktop;node_modules/react-native-fs/desktop;node_modules/react-native-http-bridge/desktop;node_modules/react-native-webview-bridge/desktop;modules/react-native-status/desktop"
/path-to-status-react/modules/react-native-status/desktop/rctstatus.cpp:22:10: fatal error: 'libstatus.h' file not found
#include "libstatus.h"
         ^~~~~~~~~~~~~
1 error generated.
make[2]: *** [lib/CMakeFiles/react-native.dir/path-to-status-react/modules/react-native-status/desktop/rctstatus.cpp.o] Error 1
make[1]: *** [lib/CMakeFiles/react-native.dir/all] Error 2
make: *** [all] Error 2

This means you forgot to set proper paths to status-go's libstatus.h in '/path-to-status-react/modules/react-native-status/desktop/CMakeLists.txt`

npm install react-native missing packages issue

Command failed: ./build.sh -e "node_modules/react-native-i18n/desktop;node_modules/react-native-config/desktop;node_modules/react-native-fs/desktop;node_modules/react-native-http-bridge/desktop;node_modules/react-native-webview-bridge/desktop;modules/react-native-status/desktop"
CMake Error at CMakeLists.txt:18 (add_subdirectory):
  add_subdirectory given source
  "/path-to-status-react/desktop/../node_modules/react-native-i18n/desktop"
  which is not an existing directory.


CMake Error at CMakeLists.txt:18 (add_subdirectory):
  add_subdirectory given source
  "/path-to-status-react/desktop/../node_modules/react-native-config/desktop"
  which is not an existing directory.


CMake Error at CMakeLists.txt:18 (add_subdirectory):
  add_subdirectory given source
  "/path-to-status-react/desktop/../node_modules/react-native-fs/desktop"
  which is not an existing directory.


CMake Error at CMakeLists.txt:18 (add_subdirectory):
  add_subdirectory given source
  "/path-to-status-react/desktop/../node_modules/react-native-http-bridge/desktop"
  which is not an existing directory.

Missed web3 package issue

After last upgrade of react-native-desktop to the v.0.53.3 of original react-native appeared some incompatibility between react-native and web3 packages on npm install. Initially it installed usually fine, but after react-native desktop command execution web3 package is get removed from node_modules. Manual install of web3 by npm install web3 installs web3 package, but removes react-native package. Workaround or solution?

App issues

Running react-native run-desktop shows blank screen

Re-run react-native run-desktop again, this should fix it.

Cannot read property 'views' of undefined in-app message:

TypeError: Cannot read property 'views' of undefined

This error is located at:
    in main-view (created by status_im.ui.screens.desktop.main.views.main_view)
    in status_im.ui.screens.desktop.main.views.main_view (created by main-views)
    in RCTView (at View.js:71)
    in View (created by main-views)
    in main-views (created by status_im.ui.screens.desktop.main.views.main_views)
    in status_im.ui.screens.desktop.main.views.main_views (created by main)
    in RCTView (at View.js:71)
    in View (created by main)
    in main (created by status_im.ui.screens.desktop.views.main)
    in status_im.ui.screens.desktop.views.main (created by status_im.desktop.core.app_root)
    in status_im.desktop.core.app_root (created by env.desktop.main.reloader)
    in env.desktop.main.reloader
    in Unknown (at renderApplication.desktop.js:26)
    in RCTView (at View.js:71)
    in View (at renderApplication.desktop.js:25)
Starting call sendRequest on RCTNetworkingNative... method:POST url: http://localhost:8081/symbolicate

Cleaning and setting up the app again helps.

Clone this wiki locally