pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21.37k stars 1.04k forks source link

[BUG] Cannot read property 'adapter' of undefined #135

Closed nadavten closed 7 years ago

nadavten commented 7 years ago

my code:

import 'babel-polyfill';
import * as rxdb from 'rxdb';
import * as websqldb from 'pouchdb-adapter-websql';
import * as httpdb from 'pouchdb-adapter-http';
import * as repdb from 'pouchdb-replication';

rxdb.plugin(websqldb());
rxdb.plugin(httpdb());
rxdb.plugin(repdb());

TypeError: Cannot read property 'adapter' of undefined at index (c:\projects\school\node_modules\pouchdb-adapter-websql\lib\index.js:82:10) at Object. (c:\projects\school\server\data\db.js:7:13) at Object. (c:\projects\school\server\data\db.js:43:3) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19)

pubkey commented 7 years ago

The imports are wrong. Check out the example here

If you want to use import you have to figure out what the adapters export as default.