Update to 3.5.3 and PouchDB


#1

Since the update to Ionic 3.5.3 and app-scripts 2.0.2 today, I’m getting the following error when using PouchDB:

ERROR Error: Uncaught (in promise): TypeError: __WEBPACK_IMPORTED_MODULE_1_pouchdb__ is not a constructor
TypeError: __WEBPACK_IMPORTED_MODULE_1_pouchdb__ is not a constructor
    at DatabaseProvider.webpackJsonp.192.DatabaseProvider.initDB (database.ts:19)
    at app.component.ts:20
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (core.es5.js:4149)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.es5.js:4140)
    at t.invokeTask (polyfills.js:3)
    at DatabaseProvider.webpackJsonp.192.DatabaseProvider.initDB (database.ts:19)
    at app.component.ts:20
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (core.es5.js:4149)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.es5.js:4140)
    at t.invokeTask (polyfills.js:3)
    at c (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.es5.js:4140)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at o (polyfills.js:3)
    at HTMLDocument.invoke (polyfills.js:3)

Do you know, what’s the problem?


#2

Same problem here. I changed the import statement from:

import * as PouchDB from 'pouchdb';

to

import PouchDB from 'pouchdb';

and it worked again.


#3

Probably caused by the upgraded webpack now used in app-scripts.


#4

Thank you. This was the solution for me.