r/CouchDB • • Mar 21 '25

pouchdb-adapter-memory: Uncaught ReferenceError: global is not defined

Hi, i want to use in-memory database, but it throws error:

Uncaught ReferenceError: global is not defined    immediate pouchdb-adapter-memory.js:1677

I'm on client side. Why client in-memory DB requeres node?? Any way i can fix this?

import PouchDB from "pouchdb-browser"; // tried with "pouchdb also"
import PouchDBMemory from "pouchdb-adapter-memory";

PouchDB.plugin(PouchDBMemory); // Here is error
3 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/helloejsulit May 04 '25

I checked the docs and it looks interesting. I might check it out for myself as well. Looks fun

1

u/skorphil May 04 '25

Yeah, its something fresh. I'm glad i found it - fits nice into my client-side app

If you are interested, you can check it in my code: https://github.com/skorphil/savnote

1

u/helloejsulit May 04 '25

Oh wow, cool! I'll have a look. Thanks for sharing!