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

6.3.2 Error: Invalid Adapter: https #6603

Closed
jefbarn opened this issue Jul 13, 2017 · 9 comments
Closed

6.3.2 Error: Invalid Adapter: https #6603

jefbarn opened this issue Jul 13, 2017 · 9 comments

Comments

@jefbarn
Copy link
Contributor

jefbarn commented Jul 13, 2017

Issue

After updating to pouchdb 6.3.2, upon initializing the PouchDB instance, it throws an 'Error: Invalid Adapter: https' error.

Info

Browser (Chrome 59)
Webpack
Custom build

Reproduce

Write the steps for others to reproduce issue here. Providing a code example, links to a repository or a live example (JSBin etc) are even more helpful.

import PouchDB from 'pouchdb-core'
import * as PouchHttp from 'pouchdb-adapter-http'
import * as PouchAuth from 'pouchdb-authentication'
import * as PouchFind from 'pouchdb-find'

PouchDB.plugin(PouchHttp)
PouchDB.plugin(PouchAuth)
PouchDB.plugin(PouchFind)

PouchDB(url, {
      skip_setup: true,
      ajax: {
        timeout: 30000
      }
    })

Worked in 6.2.0

@daleharvey
Copy link
Member

6.3.2 was a broken release, apologies, hopefully 6.3.4 should be fixed

@jefbarn
Copy link
Contributor Author

jefbarn commented Jul 15, 2017

Just tried again on 6.3.4, same error.

Did something change with the ES module packaging? Wondering if I need to tweak my webpack settings.

@daleharvey daleharvey reopened this Jul 15, 2017
@daleharvey
Copy link
Member

Nothing should have, we introduced 1 new dependency and that seems to have a large knock on effect, does import PouchDB from 'pouchdb' work?

@jefbarn
Copy link
Contributor Author

jefbarn commented Jul 15, 2017

I installed the 'pouchdb' npm module and switched to import PouchDB from 'pouchdb'
now I get

core.es5.js:1020 ERROR Error: Uncaught (in promise): ReferenceError: _global is not defined
ReferenceError: _global is not defined
    at zone.js:1476
    at attachBrowserEvents (index-browser.es.js:497)
    at new Changes (index-browser.es.js:512)
    at Object.<anonymous> (index-browser.es.js:4794)
    at Object.936 (index-browser.es.js:12183)
    at __webpack_require__ (bootstrap aba318c…:49)

Update: I'm seeing this error with the bare 'pouchdb' module on 6.2.0 also, so may be unreleated.

@riddla
Copy link

riddla commented Jul 17, 2017

@jefbarn, @daleharvey: This error stems from a corrupt zonejs release, see angular/zone.js#835. Locking zonejs to "zone.js": "0.8.12" solves the _global is not defined error.

@jefbarn
Copy link
Contributor Author

jefbarn commented Jul 17, 2017

@riddla Thanks for the heads up on the zone.js issue. It did fix the _global is not defined. Unfortunately, I'm still having problems with the latest pouchdb build using plugins.
Using pouchdb-browser now, and trying to attach pouchdb-find plugin,
core.es5.js:1020 ERROR Error: Uncaught (in promise): TypeError: this.find is not a function
(I extend the Pouchdb object, hence 'this.find')

Looks like I'm still stuck on pouchdb 6.2.0 for now.

@riddla
Copy link

riddla commented Jul 17, 2017 via email

@jefbarn
Copy link
Contributor Author

jefbarn commented Jul 17, 2017

@riddla Awesome, that was the trick!
This is working now:

import PouchDB from 'pouchdb-core'
import PouchHttp from 'pouchdb-adapter-http'
import PouchAuth from 'pouchdb-authentication'
import PouchFind from 'pouchdb-find'

PouchDB.plugin(PouchHttp)
PouchDB.plugin(PouchAuth)
PouchDB.plugin(PouchFind)

...

@jefbarn
Copy link
Contributor Author

jefbarn commented Jul 17, 2017

Closing, have solution by slightly modifying the ES6 import syntax. (see above)

@jefbarn jefbarn closed this as completed Jul 17, 2017
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

3 participants