Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while opening the database on React 0.71.2 #552

Open
alejandro-devop opened this issue Feb 9, 2023 · 2 comments
Open

Error while opening the database on React 0.71.2 #552

alejandro-devop opened this issue Feb 9, 2023 · 2 comments

Comments

@alejandro-devop
Copy link

Error while opening the database on React 0.71.2

Expected Behavior

Open the database as expected

Current Behavior

image

Possible Solution

I'm not sure of what can be done to solve this

Steps to Reproduce (for bugs)

Just follow the instructions in the readme file.

Context

Cannot use the library with the latest version of react-naive.

Your Environment

  • React Native SQLite Storage Version used: 6.0.1
  • React Native version used: 0.71.2
  • Operating System and version (simulator or device): Device and simulator
  • IDE used: Visual studio code.
  • Link to your project:

Debug logs

 LOG  Running "SQLiteApp" with {"rootTag":1,"initialProps":{}}
 LOG  Queries:  ["CREATE TABLE IF NOT EXISTS todos ( name TEXT NOT NULL, description TEXT, isCompleted INTEGER )"]
 LOG  Error:  [TypeError: Cannot convert null value to object]
Process terminated. Press <enter> to close the window

Note: I got another project using react-native 0.69.5, and the library works as expected, what leads me to think it's only happening with the latest version of react-native, the following is an output executing a query (With wrong syntax sorry) on react-native 0.69.5.

image

@leonardoballand
Copy link

leonardoballand commented Feb 19, 2023

Hello @alejandro-devop, I've finally found a solution working for me (RN 0.71.3). Hope it helps:

  • uninstall app (I guess that's this step which saved me)
  • make sure you followed install instructions for your supported platform (this link could help you)
  • make sure (with DBBrowser for SQLite for example) that your db file is OK
  • use this code to open your database => openDatabase({ name: 'filename.db', createFromLocation: 1, location: 'Library'})
  • do not hesitate to clear and re-add your db file in the native projects just to be sure
  • reinstall app

Should be working now

@ThushalIntervest
Copy link

@alejandro-devop did you find any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@leonardoballand @alejandro-devop @ThushalIntervest and others