Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

es modules issue #69

Open
oliviertassinari opened this issue Oct 15, 2017 · 2 comments
Open

es modules issue #69

oliviertassinari opened this issue Oct 15, 2017 · 2 comments

Comments

@oliviertassinari
Copy link
Contributor

oliviertassinari commented Oct 15, 2017

I have noticed the following issue in my console:

TypeError: Promise is not a constructor
at PouchDB$3.eval (pouch-utils.js:51)
at PouchDB$3.eval [as dump] (pouch-utils.js:31)
at eval (API.js:125)
at

var Promise = require('pouchdb-promise');

Applying the following diff in pouchdb-replication-stream/lib/pouch-utils.js fix my issue:

'use strict';

var Promise = require('pouchdb-promise');
+
+Promise = Promise.default
@oliviertassinari
Copy link
Contributor Author

The semver of pouchdb-promise seems not to have been respected. I think that it's the root of the issue. The latest version is 6.3.4, the export must have been changed along the way.

"pouchdb-promise": "^6.0.4",

scottmtp added a commit to scottmtp/shuttle that referenced this issue Oct 22, 2017
@isumix
Copy link

isumix commented Sep 30, 2019

There is solution to resolve alias in webpack config:

    resolve: {
      alias: {
        'pouchdb-promise$': "pouchdb-promise/lib/index.js"
      }
    }

see here: pouchdb-community/pouchdb-quick-search#81

But I could't find how to resolve alias in create-react-app without ejecting.
So I've just imported plugin from dist like:
var replicationStream = require('pouchdb-replication-stream/dist/pouchdb.replication-stream.min.js');
Hope this helps someone.
Is there any better way of doing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants