cdaringe / pouchy

A simple, opinionated interface for PouchDB :pouch:

Home Page:http://cdaringe.github.io/pouchy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't find variable: Buffer

philohelp opened this issue · comments

commented

I'm trying to have Pouchy work with SQlite on an Expo/react-native app but with no success.

import Expo, { SQLite } from "expo";
import SQLiteAdapterFactory from "pouchdb-adapter-react-native-sqlite";
const Pouchy = require('pouchy')
const SQLiteAdapter = SQLiteAdapterFactory(SQLite);
Pouchy.plugin(SQLiteAdapter);

const fruit = new Pouchy({ name: "fruit" });
    fruit
      .save({ type: "orange", tastes: "delicious" })
      .then(orange => console.log(orange));

simulator screen shot

@philohelp, im so sorry! i can't believe i didn't see this! i monitor my issues fairly closely, but somehow didn't catch this!

i tried to fire something up to help debug this, but the deps in your stack don't transpile to es5, and i don't have experience deploying react native stuff.

anyway, i'm almost certain that this error is rooted in the pouchdb-adapter-react-native-sqlite package, or it's interop with Pouch. my get tells me you probably also saw this with PouchDB direct (which you can use by just calling Pouchy.PouchDB(...normal-pouch-args), bypassing Pouchy entirely. My guess is that whatever device you ran this on doesn't have the Buffer API exposed, and that lib should have provided an implementation.

did you find a way to get it to buck?

closing due to no response. again, apologies on the delay