1

terminal Screenshot of error

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.