apache / apache/pouchdb

pouchdb-browser in SharedWorker

Open
#8,865 2 comments 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
Error start 'pouchdb-browser' in SharedWorker

### Info
- Environment: browser
- Platform: Chrome
- Adapter: indexeddb
- Server: none

### Reproduce
I tried to run the 'pouchdb-browser' in the browser and nothing worked:

```
pnpm install --save pouchdb-browser
pnpm i --save-dev @types/pouchdb-browser
```

in SharedWorker

```ts
import PouchDB from 'pouchdb-browser'

const = new PouchDB('test')

```
![image](https://github.com/pouchdb/pouchdb/assets/6965699/43b168aa-ee9d-45f0-a59c-978b0a640d0b)
![image](https://github.com/pouchdb/pouchdb/assets/6965699/7fc89c2d-d150-4d24-b81a-40e37b986484)

Can this be somehow fixed or resolved?
Thank you.

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the pouchdb-browser import and initialization in a Chrome SharedWorker with the IndexedDB adapter, then inspect the package entry point and worker-related behavior. Done means the failure is reproduced and the SharedWorker use case is either supported or clearly documented as unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
databases, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.