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

In a Node.js environment, throws a resource lock error. #1705

Open
KotoriMinami opened this issue Nov 13, 2023 · 4 comments · May be fixed by #1707
Open

In a Node.js environment, throws a resource lock error. #1705

KotoriMinami opened this issue Nov 13, 2023 · 4 comments · May be fixed by #1707

Comments

@KotoriMinami
Copy link

My basic code is as follows.

import { mySchema } from './model/schema.js'

import SQLiteAdapter from "@nozbe/watermelondb/adapters/sqlite/index.js";

const adapter = new SQLiteAdapter({
    dbName: 'test',
    schema: mySchema,
    onSetUpError: error => {
        // Database failed to load -- offer the user to reload the app or log out
        console.log(error)
    }
})

At this point, running the code produces the following results.
image
How should it be handled?

@GitMurf
Copy link

GitMurf commented Sep 15, 2024

@KotoriMinami I am having this exact same issue. It looks like from the stack trace in your image that you are on Windows? I am on Windows as well.

See #1810 (comment) for details on my issues.

@KotoriMinami
Copy link
Author

@GitMurf
Yes, I encountered this issue on Windows, but it's completely fine on Mac.
I resolved it by applying the PR's code locally on my machine,
and it's been running for about a year without any significant issues.
I'm not sure if your issue is the same as mine, but you can give it a try and see if it solves your problem.

@GitMurf
Copy link

GitMurf commented Sep 20, 2024

I resolved it by applying the PR's code locally on my machine,

and it's been running for about a year without any significant issues.

Thanks! And to be clear, all it needs are these 3 lines added from here: 59f87f1 ?!!

@KotoriMinami
Copy link
Author

I resolved it by applying the PR's code locally on my machine,
and it's been running for about a year without any significant issues.

Thanks! And to be clear, all it needs are these 3 lines added from here: 59f87f1 ?!!

Yes, that's exactly how I did it.

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