You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import React, { useContext } from 'react';
import PouchDB from 'pouchdb-react-native';
import PouchAuth from 'pouchdb-authentication';
import PouchAsyncStorage from 'pouchdb-adapter-asyncstorage';
import { storeData } from './storageManager';
Yeah it seems to be the asyncstorage has been removed from react-native latest versions. AsyncStoragePouch.valid = () => { try { return require('@react-native-async-storage/async-storage').default !== null } catch (error) { return false } }
quick fix change the asyncstorage from react-native to @react-native-async-storage/async-storage node_modules/pouchdb-adapter-asyncstorage/src/index.js then run npx patch-package pouchdb-adapter-asyncstorage
I updated my expo version from 47 to 49 and I get this error after execution.
Error: Invalid Adapter: asyncstorage, js engine: hermes
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError
at node_modules\expo\build\errors\ExpoErrorManager.js:null in createErrorHandler
at node_modules\expo\build\errors\ExpoErrorManager.js:null in
at node_modules@react-native\js-polyfills\error-guard.js:null in ErrorUtils.applyWithGuard
at node_modules\metro-runtime\src\polyfills\require.js:null in guardedLoadModule
at http://192.168.1.137:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:null in metroRequire
at http://192.168.1.137:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:null in global
The code :
import React, { useContext } from 'react';
import PouchDB from 'pouchdb-react-native';
import PouchAuth from 'pouchdb-authentication';
import PouchAsyncStorage from 'pouchdb-adapter-asyncstorage';
import { storeData } from './storageManager';
PouchDB.plugin(PouchAuth);
PouchDB.plugin(require('pouchdb-upsert'));
PouchDB.plugin(require('pouchdb-find'));
PouchDB.plugin(PouchAsyncStorage);
let LocalDatabase = new PouchDB('db_name', {
adapter: 'asyncstorage',
});
The text was updated successfully, but these errors were encountered: