vasern / vasern

Vasern is a fast, lightweight and open source data storage for React Native

Home Page:https://vasern.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Couldn't find preset "module:metro-react-native-babel-preset"

apppro123 opened this issue · comments

First: Can i store/get objects with vasern in/from the local storage at any time over the different files?

And second: Why is there a second react-native module in vasern installed (i have already installed react native normally!)? I have the problem that i cannot run it with two of them!
And when i delete react-native there is another issue about babel!

Hi @apppro123

First: Can you clarify what are "different files"? Also since Vasern is a local storage itself, I am confused about "the local storage" that you mentioned? Are you trying to sync data with an existing local storage? (It'd be great if you can provide a specific example)

Sure you can store and get objects with Vasern at any time. Though it needs a schema and might need to convert the format between 2 local storage.

Second: There are a few things need to be clean up in the "package.json". I'll have a look and push a fix (hopefully within today)

I have pushed a fix (clean up dependencies) 9b73f9b

You can remove and reinstall the lastest version (0.2.9) to apply changes

At the moment i get this issue (after updating):
error: bundling failed: Error: Couldn't find preset "module:metro-react-native-babel-preset" relative to directory "C:\Users\kalla\OwnApp\node_modules\vasern"

It might related to this issue facebook/react-native#21241 (comment). There are also severals fixes in the same topic

After i deleted .babelrc it build it but on the screen it shows another error related to Document.js

for example the last line Document.import(Queryable);
What does this line do? And why is not the import at the beginning of this file like every other import?
And with Queryable, is the file Queryable.js meant?

After i removed this line (line 538 in Document.js) it worked (i can now import Vasern from "vasern")

Vasern has a modular architecture (basically it was built in different parts and then plug in together).

When you removed Document.import(Queryable), you have just detached retrieve and filter items functions. So the Document.data() and Document.get() didn't works as you described on #7

Can you help me to clarify things below?

  1. Make sure the Document.import(Queryable) is at the end of Document.js

  2. Since it complains about metro-react-native-babel-preset, have you got it on your package.json, under devDependencies? If not, install and save it to dev

npm install --save-dev metro-react-native-babel-preset

Once you complete, start your project and see if the error is still there. If it does, then go to the next step.

  1. Setup your project using metro-react-native-babel-preset. If your project has already used another babel preset, you might get complain in your current apps.

Create a .babelrc in the root of the project, and add this line

{
  "presets": ["module:metro-react-native-babel-preset"]
}

Let me know how it goes!

Now it works (after i updatet react-native and babel).
I have another question: Which permissions does vasern need?

Great!
I am not sure which permission you want to know? Currently, Vasern doesn't require any permission in either application settings or input/output data files.

Ok, thank you!

No worries, I'm glad it helps!

Since you have solved the problem by update react-native and babel. I'll go ahead and close this issue. Feel free to reopen or create another issue :)

Yes, perfect ty!