neo4j / neo4j-javascript-driver

Neo4j Bolt driver for JavaScript

Home Page:https://neo4j.com/docs/javascript-manual/current/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native compatibility

tomasAlabes opened this issue · comments

Hi, I'm using the use-neo4j library to build an app that communicates with Neo4j Cloud AuraDB. Using React Native. While building for the app for it, this happens:

Android Bundling failed 4588ms
Unable to resolve module net from ~/Documents/ActiveProjects/connections/node_modules/neo4j-driver-bolt-connection/lib/channel/node/node-channel.js: net could not be found within the project or in these directories:
  node_modules

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
  22 |  * limitations under the License.
  23 |  */
> 24 | var net_1 = __importDefault(require("net"));
     |                                      ^
  25 | var tls_1 = __importDefault(require("tls"));
  26 | var fs_1 = __importDefault(require("fs"));
  27 | var channel_buf_1 = __importDefault(require("../channel-buf"));

I think it's related to #396

Could this driver be platform agnostic?

use-neo4j: 0.3.6
neo4j-driver-bolt-connection: 4.4.1
neo4j-driver-core: 4.4.1
react-native: 0.64.3
expo: 4.12.8

Hi @tomasAlabes,

We currently only support browser and nodejs. I'm not that familiar with the React Native ecosystem/environment.

You can install and configure replacement libraries like react-native-tcp. However, I can not guarantee you will find replacements for all the nodejs's libraries used in the driver.

I will forward this demand for our product team.

Thanks for reporting.

Hi @bigmontz, thanks for the answer. I'm not an expert on RN either so I can't help much on recommendations or suggestions. The suggested lib didn't seem to work.
I was trying to build a simple app with a cloud graph db. Something like with firebase. Being that RN is so widely used, it would be nice to have a sample app with the minimal setup.