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: Couldn't find preset "module:metro-react-native-babel-preset" #6

Closed
apppro123 opened this issue Nov 27, 2018 · 12 comments
Closed

Comments

@apppro123
Copy link

apppro123 commented Nov 27, 2018

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!

@hieunc229
Copy link
Contributor

hieunc229 commented Nov 27, 2018

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)

@hieunc229
Copy link
Contributor

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

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

@apppro123
Copy link
Author

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"

@hieunc229
Copy link
Contributor

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

@apppro123
Copy link
Author

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?

@apppro123
Copy link
Author

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

@hieunc229
Copy link
Contributor

hieunc229 commented Nov 29, 2018

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!

@hieunc229 hieunc229 changed the title Question and Issue Error: Couldn't find preset "module:metro-react-native-babel-preset" Nov 29, 2018
@hieunc229 hieunc229 reopened this Nov 29, 2018
@apppro123
Copy link
Author

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

@hieunc229
Copy link
Contributor

hieunc229 commented Nov 30, 2018

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.

@apppro123
Copy link
Author

Ok, thank you!

@hieunc229
Copy link
Contributor

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 :)

@apppro123
Copy link
Author

Yes, perfect ty!

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

2 participants