1
votes

When I deployed my cordova app with PouchDB using Visual Studio containing the following code snippet

  // Initialise a sync with the remote server
  function sync() {
    syncDom.setAttribute('data-sync-state', 'syncing');
    var opts = {live: true};
    db.replicate.to(remoteCouch, opts, syncError);
    db.replicate.from(remoteCouch, opts, syncError);
  }

It syncs properly with CouchDB server when I deploy on VS Android Emulator and Android Device. But it does not sync when I deployed on Ripple Emulator, WP8 and Windows 8 Store App.

Debugging show the following error. xhr_proxy - Failed to load resource: net::ERR_CONNECTION_REFUSED

I tried using both VS2013 and VS2015. Both have the same outcome.

Is there any build settings that I need to do for WP8 and Windows 8 Store App for this to work like it does on Android?

1

1 Answers

0
votes

I was encountering the same error. Have you installed CORS?

    npm install -g add-cors-to-couchdb
    add-cors-to-couchdb

See http://pouchdb.com/getting-started.html for more details