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

[RN 0.52.0] Unknown named module: 'react' #9

Closed
mobdim opened this issue Jan 10, 2018 · 10 comments
Closed

[RN 0.52.0] Unknown named module: 'react' #9

mobdim opened this issue Jan 10, 2018 · 10 comments

Comments

@mobdim
Copy link

mobdim commented Jan 10, 2018

Hello.

After upgrade react-native (0.52.0) I receive this error: Unknown named module: 'react'
image

Steps to Reproduce

  • Create new proj via react-native init
  • Install this plugin
  • Important! Change file App.js:
const App = () => (
  <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <Text style={styles.instructions}>
          To get started, edit App.js
        </Text>
        <Text style={styles.instructions}>
          {instructions}
        </Text>
      </View>
)

export default App

Just run react-native run-ios

@bvic23
Copy link
Owner

bvic23 commented Jan 10, 2018

Did you try to reset the cache and restart the packager? Something like this:

rm -rf node_modules/
yarn install
watchman watch-del-all
rm -rf $TMPDIR/react-*

and restart the packager.

@mobdim
Copy link
Author

mobdim commented Jan 10, 2018

@bvic23 Yes, I've tried everything:

watchman watch-del-all
rm -rf $TMPDIR/react-*
rm -rf node_modules/
rm yarn.lock
rm package-lock.json
npm cache clean --force
yarn cache clean
yarn install

And restart

watchman watch-del-all && npm start -- --reset-cache

The only problem on RN 0.52.0 if you use RN 0.51.0, then everything is fine.

@bvic23
Copy link
Owner

bvic23 commented Jan 10, 2018

I see :-(. Let me look into it and @mobdim feel free to send a PR if you find the solution earlier.

@fossage
Copy link

fossage commented Jan 24, 2018

Same issue here. Also on RN 0.52.0.

@onrige
Copy link

onrige commented Jan 29, 2018

Also have this issue. It comes from metro bundler I think.

"If you have any scripts in your project that depend on metro-bundler, you will need to change those to metro (related commit). A likely place for this is in rn-cli.config.js.

@Gyran
Copy link
Contributor

Gyran commented Feb 8, 2018

A new version is now available that should close this
It was fixed in #10

@bvic23
Copy link
Owner

bvic23 commented Feb 8, 2018

Thanks to @Gyran!

@bvic23 bvic23 closed this as completed Feb 8, 2018
@Gyran
Copy link
Contributor

Gyran commented Feb 12, 2018

Are you using Yarn? sure the latest version is downloaded?

@hbarylskyi
Copy link

@Gyran everything worked after I ran react-native start --reset-cache :) Thank you for the fix.

@justertee
Copy link

@Gyran @hbarylskyi thanks for much!
I ran react-native start --reset-cache and fixed hot reload on react native version 0.54

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

7 participants