apache / apache/pouchdb

Cannot use PouchDB as external import in `type="module"` scripts

Open
#9,057 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17.6k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### Issue

Hey, try this out:

```js
import * as PouchDB from 'https://cdn.jsdelivr.net/pouchdb/latest/pouchdb.js'

console.log(PouchDB)
const db = new PouchDB('alchemist-todo')
```

It fails:

```
Object { … }
Symbol(Symbol.toStringTag): "Module"
Uncaught TypeError: PouchDB is not a constructor
```

I realize this usage isn't in the docs, but, why shouldn't it work these days?

### Info
- Environment: browser
- Platform: Chrome
- Adapter: pre-adapter problem
- Server: N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.