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 on react-native-windows - Cannot read property 'exec' of undefined when running executeSql #96

Open
saurabhj91 opened this issue Apr 28, 2021 · 3 comments

Comments

@saurabhj91
Copy link

Hi There,

I'm working on react-native-windows, below is the version information

"react": "17.0.1",
"react-native": "0.64.0",
"react-native-windows": "^0.64.0-0"
"react-native-sqlite-2": "^3.3.0",

I was able to open the database as mentioned in the docs, while executing the query I am getting the error Uncaught TypeError: Cannot read property 'exec' of undefined at SQLiteDatabase.exec

Below is the code of executing the query,

db.transaction(txn => {
        console.log(txn);
        txn.executeSql(
            "CREATE TABLE IF NOT EXISTS USERS(user_id INTEGER PRIMARY KEY NOT NULL, name NVARCHAR(30), password NVARCHAR(8))",
            [],
            successCB,
            errorCB
        );

I have also added console for db and txn to check if anything is not working on that side, but as you can see the console for db and txn are coming. Below are the screenshots of the same

image

image

Please let me know if I have missed any step or need to add any dependency which is causing the issue.

@craftzdog
Copy link
Owner

Windows support is out of scope for me.
Maybe @hnq90 can help you.

@emaitee
Copy link

emaitee commented Sep 13, 2021

Any solution to this issue? I'm also currently facing the same challenge please help.
I have the following versions running,

"react": "17.0.1",
"react-native": "0.64.1",
"react-native-sqlite-2": "^3.4.1",
"react-native-windows": "0.64.17",

@saurabhj91
Copy link
Author

@emaitee No update, we ditched react native.

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

3 participants