I'm attempting to integrate SQLite into my Expo project using expo-sqlite. However, when I run the project, I encounter the following error:
(NOBRIDGE) ERROR Error: Cannot find native module 'ExpoSQLite' [Component Stack]
(NOBRIDGE) WARN Route "./note/index.tsx" is missing the required default export. Ensure a React component is exported as default. [Component Stack]
Steps Taken:
- Installed expo-sqlite using
npx expo install expo-sqlite - Followed the basic usage instructions from the expo-sqlite documentation
Expected Behavior: The project should run successfully and allow me to interact with the SQLite database as per the expo-sqlite documentation.
Environment:
- Expo SDK Version: 52.0.23
- Tinybase Version: 5.4.5
Code Snippet (if applicable):
export default function NoteApp(){
const store = useCreateStore(createStore);
useAndStartPersister(store);
return(
// TSX
)
}
const useAndStartPersister = (store : any) =>
// Persist store to Expo SQLite or local storage; load once, then auto-save.
useCreatePersister(
store,
(store) =>
Platform.OS === 'web'
? createLocalPersister(store, 'todos')
: createExpoSqlitePersister(store, SQLite.openDatabaseSync('todos.db')),
[],
// @ts-ignore
(persister) => persister.load().then(persister.startAutoSave)
);
I have tried reinstalling node modules, clearing cache, etc.
Expected Behavior: The project should run successfully and allow me to interact with the SQLite database as per the expo-sqlite documentation.