Error: Cannot call database.adapter.underlying Adapter while the database is being reset watermelondb

279 Views Asked by At

Exception com.facebook.react.common.JavascriptException: Error: Cannot call database.adapter.underlyingAdapter while the database is being reset

I can see multiple crashes in the play store with the above stack trace, I am using watermelon DB in react native.

what might causing this issue?

1

There are 1 best solutions below

0
Michael Maaß On

For this to occur two things need to happen:

  • You've initiated the reset of the watermelondb await database.unsafeResetDatabase()
  • A component which is connected to watermelondb e.g. via the withObservables HOC gets mounted and makes a database request.

So you have to check which component gets mounted during the reset process.