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

TypeError: utils.Promise.all is not a function #47

Open
SearchingSoul opened this issue Jul 21, 2017 · 4 comments
Open

TypeError: utils.Promise.all is not a function #47

SearchingSoul opened this issue Jul 21, 2017 · 4 comments

Comments

@SearchingSoul
Copy link

I am using crypto-pouch with indexed-db and I receive the error:
TypeError: utils.Promise.all is not a function

Found that 'utils.Promise.all' should be 'utils.Promise.default.all' for IndexedDB. Could this be a bug?

It may affect all 'utils.Promise.' to become 'utils.Promise.default.'

using pouchdb@6.3.4, crypto-pouch@3.1.2, transform-pouch@1.1.3

@lent
Copy link

lent commented Oct 27, 2017

I guess this is because of the mix of 'import' and 'require'. Would be nice if transform-pouch would switch to 'import'.
Also, transform-pouch could use pouchdb-utils instead of it's own version. Then, there's no need for an extra 'lie' import.
As a quick workaround, I change webpack's resolve.alias to fallback to not es6 versions of:

resolve: {
  alias: {
    'pouchdb-promise':  'pouchdb-promise/lib/index',
    'lie':              'pouchdb-promise/lib/index',
    'pouchdb-utils':    'pouchdb-utils/lib/index'
  }
}

@SearchingSoul
Copy link
Author

@lent, thanks for the insight & the workaround. It works.

I will leave this open as a feature request as per your suggestion to the developers/maintainers if they think they want to switch to 'import'

@ygr1k
Copy link

ygr1k commented Dec 2, 2018

hello, found a same bug

@dodongphure
Copy link

Have same issue.

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

4 participants