PouchDB works in Browser, not in iOS/Android


#1

Hello together,

my application is using PouchDB for data storage and synchronization.
This is working perfectly within the browser, however, it doesn’t on the device or simulator.
I get the error that PouchDB is not defined.
I have integrated it like this in my index.html:

I also tried to add the module “pouchdb” to angular.module(’…’, [‘ionic’, ‘pouchdb’, ‘…’]), but that doesn’t work either.

Any ideas?

Many thanks in advance!


#2

Just found the solution by myself :blush::
Instead of referencing pouchdb remotely in my index.html, like this:

I have copied the file and stored it locally, which led to success:

Maybe this is going to help someone else as well!


#3

Unfortunately one can’t see the code you posted, could you post that again? This would be quite helpful.

thx


#4

Hi, @p6n Could you please repost the code you mentioned? I am currently experiencing a similar problem.


#5

hi @wilsonmaravilha,

it’s just that I didn’t reference the pouchdb js file remotely but directly as a local js file.
However, I switched to a MBaaS and am not using Pouch anymore.

Best,

David


#6

Can you please let us know which MBaaS service / plugin you are using ? pouchdb is useless and need an alternative