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

Cannot find module 'babel-preset-react-native' #1782

Closed
arhmnsh opened this issue Oct 22, 2018 · 3 comments
Closed

Cannot find module 'babel-preset-react-native' #1782

arhmnsh opened this issue Oct 22, 2018 · 3 comments

Comments

@arhmnsh
Copy link

arhmnsh commented Oct 22, 2018

I have followed this tutorial to implement MobX in my React Native (v"0.57.1") project.

I am getting this error when I run my app

Cannot find module 'babel-preset-react-native'

As suggested in that article, I have installed @babel/plugin-proposal-decorators and set up the .babelrc file accordingly.

Here is the screenshot of the error and my config.

screen shot 2018-10-22 at 6 40 37 am

@mweststrate
Copy link
Member

The issue seems unrelated to MobX, but you might try the example configuration shown here: oblador/react-native-vector-icons#801 (comment), or ask the blog author to update his blog post?

The clue is that the @babel/plugin-proposal-decorator plugin should be installed, as first plugin and in legacy mode, and beyond that the standard React Native setup / process work. So I think you can just generate a vanilla RN project, and then apply the instructions shown here: https://github.com/facebook/metro/tree/master/packages/metro-react-native-babel-preset

N.B., for setup simplicity I recommend to use mobx@4 and not latest if you want to target Android

@mweststrate
Copy link
Member

Closing for lack of further information, and issue sems to be unrelated to mobx

@lock
Copy link

lock bot commented Jul 21, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants