This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
React Native Encrypted Storage Error: RNEncryptedStorage is undefined #34
Comments
0526tracy
changed the title
React Native Encrypted Storage error: Error: RNEncryptedStorage is undefined
React Native Encrypted Storage Error: RNEncryptedStorage is undefined
Dec 17, 2020
This module does not support Expo since it uses native code. |
I don't use expo but I still get that error !! @emeraldsanto |
If someone happens to stumble across this issue try the following steps:
Final step seems to have resolved the issue for me 👌 |
This is not an expo. I try to run the test. The project has a mock for encrypted storage.// jest.config.ts setupFiles: ['<rootDir>/test/setup.ts'], // test/setup.ts import 'react-native'
// libraries to mock
import './mock-safe-area-context'
import './mock-react-native-encrypted-storage'
jest.useFakeTimers()
declare global {
// eslint-disable-next-line no-underscore-dangle
let __TEST__
} // test/mock-react-native-encrypted-storage.ts const RNEncryptedStorage = {
setItem: jest.fn(() => Promise.resolve()),
getItem: jest.fn(() => Promise.resolve('{ "foo": 1 }')),
removeItem: jest.fn(() => Promise.resolve()),
clear: jest.fn(() => Promise.resolve()),
};
export default RNEncryptedStorage; |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi !is anyone here ever encountered this?
Im using expo in my current project, then i tried to use react-native-encrypted-storage
I follow the steps here (https://www.npmjs.com/package/react-native-encrypted-storage)
but i got this error when i run expo start
The text was updated successfully, but these errors were encountered: