最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to use Sqlite with expo in React Native? - Stack Overflow

programmeradmin7浏览0评论

Does 'react-native-sqlite-storage' work with expo or it is pulsory to use expo-sqlite. I am trying to create an app which heavily depends on a database but for some reason 'react-native-sqlite-storage' shows me two error,

ERROR TypeError: Cannot convert null value to object, js engine: hermes

and

ERROR Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes

Furthermore, there seems to be very little information regarding this error online and that's when I found out about expo-sqlite.

Does 'react-native-sqlite-storage' work with expo or it is pulsory to use expo-sqlite. I am trying to create an app which heavily depends on a database but for some reason 'react-native-sqlite-storage' shows me two error,

ERROR TypeError: Cannot convert null value to object, js engine: hermes

and

ERROR Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes

Furthermore, there seems to be very little information regarding this error online and that's when I found out about expo-sqlite.

Share Improve this question asked Jul 13, 2023 at 11:13 jay shahjay shah 712 silver badges9 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You can use expo-sqlite (https://docs.expo.dev/versions/latest/sdk/sqlite/)

Using react-native-sqlite-storage seems to be not an good idea:

  1. You won’t be able to use react-native-sqlite-storage as it contains native code
  2. The project seems to be no longer maintained

Technically you can use the module by building your own expo client or eject the app but you should not do that if it isn‘t really necessary.

发布评论

评论列表(0)

  1. 暂无评论