react-native-replicache
react-native-replicache copied to clipboard
react-native-quick-sqlite - fails with Possible Unhandled Promise Rejection
I'm attempting to implement the react-native-quick-sqlite package and the replicache instantiation fails, throws the following warning:
WARN Possible Unhandled Promise Rejection (id: 1):
Error: Did not resolve
Error: Did not resolve
I've been unable to locate the source of it as the stack trace is very generic and all inside core react-native module files
here's my implementation:
import { createReplicacheReactNativeQuickSQLiteExperimentalCreateKVStore } from '@react-native-replicache/react-native-quick-sqlite';
import { Replicache, TEST_LICENSE_KEY } from 'replicache';
export function useReplicache() {
const r = React.useMemo(
() =>
new Replicache({
licenseKey: TEST_LICENSE_KEY,
pushURL: `<my test server push url>`,
pullURL: `<my test server pull url>`,
experimentalCreateKVStore: createReplicacheReactNativeQuickSQLiteExperimentalCreateKVStore,
name: 'chat-user-id',
mutators: {},
}),
[],
);
return r;
}
here is my package.json dep list:
"dependencies": {
"@pusher/pusher-websocket-react-native": "^1.2.2",
"@react-native-community/blur": "^4.3.2",
"@react-native-community/checkbox": "^0.5.15",
"@react-native-replicache/react-native-quick-sqlite": "^1.0.0",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@react-navigation/stack": "^6.3.16",
"expo": "^48.0.0",
"expo-crypto": "~12.2.1",
"i18next": "^22.5.0",
"react": "18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^12.3.1",
"react-native": "0.71.6",
"react-native-config": "^1.5.1",
"react-native-gesture-handler": "^2.9.0",
"react-native-linear-gradient": "^2.6.2",
"react-native-quick-sqlite": "^8.0.2",
"react-native-reanimated": "2.14.4",
"react-native-safe-area-context": "^4.5.0",
"react-native-screens": "^3.20.0",
"react-native-svg": "^13.9.0",
"replicache": "^12.2.2",
"replicache-react": "^2.11.0"
},
i've added the expo-crypto
polyfill as per the example
any help appreciated! thanks!