We discussed to only update the Node NPM module after we made sure that it’s actually working with node. So I tried to get the basics working with the current node build.
Before I create any issues on Github for this, I wanted to list the problems I experienced here. Maybe I’m just too stupid and I’m “using it wrong”TM
Creating a new remoteStorage instance
var RemoteStorage = require('./remotestorage-node');
var remoteStorage = new RemoteStorage();
already fails with the error
TypeError: Cannot read property ‘connected’ of undefined
I traced this back to the WireClient not being created because it needs the XMLHttpRequest
.
Requiring the xmlhttprequest
module before remotestorage-node
fixes that.
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
I think that module should be a dependency in the package.json
then, doesn’t it?
The next problem I ran into is when trying to configure the remote via
remoteStorage.remote.configure(userAddress, serverURL, storageAPI, token);
I got an error
‘ready’ failed: Sync requires ‘local’ and ‘caching’! undefined
I couldn’t figure this one out yet. My guess is, we need the memory storage, first.
Did anybody use remoteStorage.js in node before? Is there anything else that needs to be done or are these actual bugs?