PouchDB in Nextjs throws error
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
### Issue
Whenever I try running my nextjs app using pouchDB (I am only using it on the server side and **NOT** on the client side) I get
Am I missing something?
### Info
- Environment: (Nextjs (backend code Node.js))
- Platform: (Brave)
- Adapter: (leveldb)
- Server: (no server, I am working in local with in nextjs)
### Reproduce
Initi a nextjs app. Setup pouchDB
```
import PouchDB from "pouchdb-node";
const db = new PouchDB("llmshare");
export default db;
```
use pouchDB in any API's `route.ts`
```
import { NextResponse } from "next/server";
import db from "@/db/pouchDB";
export async function GET() {
try {
const res = await db.post({ title: "new code" });
return NextResponse.json({ id: res.id });
} catch (e) {
console.log({ e });
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.