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

Doesn't work out of the box, Module not found: 'react/lib/React' #23

Closed
berstend opened this issue Jun 27, 2017 · 3 comments
Closed

Doesn't work out of the box, Module not found: 'react/lib/React' #23

berstend opened this issue Jun 27, 2017 · 3 comments
Labels

Comments

@berstend
Copy link

berstend commented Jun 27, 2017

Hi there,

after following the latest install-with-template instructions and running yarn run web the following error appears:

Failed to compile.

Error in ./~/react-dom/lib/ReactMount.js
Module not found: 'react/lib/React' in /Users/User/dev/testing/react-native/r10/node_modules/react-dom/lib

 @ ./~/react-dom/lib/ReactMount.js 1:156-182

Steps:

react-native init r10 --template everywhere
cd r10
node scripts/addDevDependencies.js
yarn run web

I thought that maybe react-dom is too old and upgraded to 16.0.0-alpha.12, which changed the error to:

Failed to compile.

Error in ./~/react-native-web/dist/modules/injectResponderEventPlugin.js
Module not found: 'react-dom/lib/EventPluginHub' in /Users/User/dev/testing/react-native/r10/node_modules/react-native-web/dist/modules

 @ ./~/react-native-web/dist/modules/injectResponderEventPlugin.js 1:20-59

Any idea where the issue might be?

I've added my current package.json here:
https://gist.github.com/berstend/02e2b3b8319a051f86353789afec6cff

@amoghbanta
Copy link
Member

Seems to be a compatibility issue with react-native-web. It is not ready for react 16 yet. Look at the note here.

Do tell me if this works for you. I'll update the dependencies and add a note in readme.

@amoghbanta amoghbanta added the bug label Jun 27, 2017
@berstend
Copy link
Author

Great, thanks for the fast reply @amoghbanta

I've followed your instructions (as well as removing the yarn.lock file) and got this error:

Failed to compile.

Error in ./~/react-native-web/dist/index.js
Module build failed: ReferenceError: Unknown plugin "transform-react-remove-prop-types" specified in "/Users/User/dev/testing/react-native/r10/node_modules/react-native-web/package.json" at 0, attempted to resolve relative to "/Users/User/dev/testing/react-native/r10/node_modules/react-native-web"
    at Array.map (native)
 @ ./index.web.js 1:164-187

After adding babel-plugin-transform-react-remove-prop-types as dependency the above error was resolved and the demo runs smoothly now. 🎉

Thanks a lot!

@emirotin
Copy link

I had the same issues with the fresh install. I'm currently trying to play with React 16 which was installed anyway as the dependency of react-native@0.49.3, so I have upgraded react-dom too. Have hit all these 3 errors, the final one being somethign wrong with the config in my understanding. So I had to add it to my dev dep too but that shouldn't be needed: necolas/react-native-web#607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants