Search code examples
javascriptnode.jsember.jsember-clirethinkdb-javascript

How can I import RethinkDB javascript library on EmberJS?


I'm trying to use RethinkDB javascript library with EmberJS. As there is no bower package for RethinkDB to install for ember, I'm trying to use npm package on ember. But I'm new to javascript as well as EmberJS I'm struggling to achieve this.

I have tried importing npm library as below but of no use.

import rethinkdb from 'npm:rethinkdb';

or on myroute.js

import rethinkdb from './node_modules/rethinkdb/rethinkdb.js';

or on ember-cli-build.js

app.import('node_modules\rethinkdb\rethinkdb.js');

nothing above worked.


Solution

  • As of now, It seems there is no ember-cli support for Rethinkdb client drivers. One of its dependency library(net.js) is written on net method of nodejs. It fails with app import on ./net module.

    Uncaught Error: Could not find module `net` imported from `(require)`
    

    Please correct me if I'am wrong and any other way to use RethinkDB with emberjs would be helpful(except websockets).