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

Database failed to load error #40

Closed
theixbass opened this issue Sep 18, 2018 · 29 comments

Comments

@theixbass
Copy link

commented Sep 18, 2018

After some time spent to set up this package in react native, got this error:

[DB] Uh-oh. Database failed to load, we're in big trouble, [TypeError: undefined is not an object (evaluating 'Native.setUp')]

I am using expo for development.

@radex

This comment has been minimized.

Copy link
Member

commented Sep 18, 2018

Hey, looks like the native module is not set up. Did you go through Installation guide for iOS/Android?

@theixbass

This comment has been minimized.

Copy link
Author

commented Sep 18, 2018

I missed defining the decorators in Model. After defining, I got an error:

Unable to resolve "@nozbe/watermelondb/decorators"

@radex

This comment has been minimized.

Copy link
Member

commented Sep 18, 2018

So, is it working now for you or still no? Your error is most likely because you forgot to add the babel plugin to your config. Note that you need to restart the bundler after doing that

@theixbass

This comment has been minimized.

Copy link
Author

commented Sep 18, 2018

Nop. Do you meen - @babel/plugin-proposal-decorators?

@radex

This comment has been minimized.

Copy link
Member

commented Sep 18, 2018

please go through https://github.com/Nozbe/WatermelonDB/blob/master/docs/Installation.md carefully one more time -- and let me know if this fixes it ;)

@tbergq

This comment has been minimized.

Copy link

commented Sep 23, 2018

I got this same error, so I went to the docs. Adding <appname>-Bridging-Header.h solved the problem for me.

@ghost

This comment has been minimized.

Copy link

commented Sep 23, 2018

@radex

This comment has been minimized.

Copy link
Member

commented Sep 24, 2018

@theixbass is this a solved issue?

@radex

This comment has been minimized.

Copy link
Member

commented Oct 4, 2018

I assume it is — closing this now. @theixbass let me know if this issue should be reopened

@radex radex closed this Oct 4, 2018

@davidwadge

This comment has been minimized.

Copy link

commented Oct 5, 2018

@theixbass I have the same problem with Expo, how did you resolve in the end (without ejecting)?

@theixbass

This comment has been minimized.

Copy link
Author

commented Oct 5, 2018

@theixbass I have the same problem with Expo, how did you resolve in the end?

I did not...

@davidwadge

This comment has been minimized.

Copy link

commented Oct 5, 2018

Okay, clearly this is not suitable for Expo at this time then. Back to RxDB it is...

@tbergq

This comment has been minimized.

Copy link

commented Oct 5, 2018

Yeah, makes sense, you probably cannot add swift files to expo project.

@radex

This comment has been minimized.

Copy link
Member

commented Oct 5, 2018

I believe you can eject to ExpoKit and then just go through standard Installation steps: https://docs.expo.io/versions/latest/expokit/expokit

@Slapbox

This comment has been minimized.

Copy link

commented Oct 19, 2018

Are there any plans to attempt to support Expo?

@radex

This comment has been minimized.

Copy link
Member

commented Oct 19, 2018

@Slapbox you can eject to ExpoKit. If you want easy built in support in Expo, you have to contact Expo ;)

@davidwadge

This comment has been minimized.

Copy link

commented Oct 19, 2018

To be honest I think it's in your interest to support Expo. Ejecting gives a developer far more choice when it comes to ORMs - you could use Realm, for example. Keeping everything in JS has significant advantages for many development teams.

@radex

This comment has been minimized.

Copy link
Member

commented Oct 19, 2018

@davidwadge What are you trying to say? Ejecting to ExpoKit should make it easy to add Watermelon as a dependency.

@davidwadge

This comment has been minimized.

Copy link

commented Oct 19, 2018

The advantage of using Expo is that you keep your codebase entirely in JS. Ejecting turns your codebase into a more native-y one, meaning I could just as well use another ORM, such as Realm for example.

@radex

This comment has been minimized.

Copy link
Member

commented Oct 19, 2018

Ejecting turns your codebase into a more native-y one, meaning I could just as well use another ORM, such as Realm for example.

Right. That's good, no?

@davidwadge

This comment has been minimized.

Copy link

commented Oct 19, 2018

Imagine you have a team of predominantly React web developers who have little to no experience with native iOS or Android development. In that circumstance, you want to keep as much as possible in JavaScript, which is why Expo exists.

@radex

This comment has been minimized.

Copy link
Member

commented Oct 19, 2018

In that circumstance, you want to keep as much as possible in JavaScript, which is why Expo exists.

That's cool, but what does that have to do with WatermelonDB? I don't decide what's part of the Expo SDK.

@Slapbox

This comment has been minimized.

Copy link

commented Oct 23, 2018

If people want WatermelonDB support in Expo, this is the place to make it known: https://expo.canny.io/feature-requests/p/add-support-for-watermelondb

@bemnet4u

This comment has been minimized.

Copy link

commented Nov 3, 2018

The thing is that expo already has support for sqlite. If that is the only native dependency you need then is it reasonable to expand expo support by writing an adapter against the expo’s SQLite interface?

@radex

This comment has been minimized.

Copy link
Member

commented Nov 3, 2018

@bemnet4u I don't think it's possible, some basic native support is needed — I think. But you can investigage if you'd like

@ymahnovskyy ymahnovskyy referenced this issue Apr 9, 2019
@drex44

This comment has been minimized.

Copy link
Contributor

commented Apr 28, 2019

I have been facing the same issue.
I started a new app using react-native. I followed general instructions and android instructions in installation.md.

can anybody help please?

@asharafshahi

This comment has been minimized.

Copy link

commented Jun 29, 2019

I got this same error, so I went to the docs. Adding <appname>-Bridging-Header.h solved the problem for me.

When doing this initially, I wasn't sure where the file needs to go and deleted it to retry. However, when following the steps again, XCode doesn't prompt to create the bridging header again. Can you explain exactly how to create this file and which folder it goes into?

@tbergq

This comment has been minimized.

Copy link

commented Jun 29, 2019

Screenshot 2019-06-29 at 19 37 12

@asharafshahi

This comment has been minimized.

Copy link

commented Jun 29, 2019

For the next person that deletes the header file, XCode won't prompt you the second time and you'll need to manually create it. Here are the instructions: https://mycodetips.com/ios/manually-adding-swift-bridging-header-1290.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.