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 resolve 'file' or 'directory' react/lib/ReactMount #11

Closed
pfncfen opened this issue Nov 24, 2016 · 3 comments
Closed

Cannot resolve 'file' or 'directory' react/lib/ReactMount #11

pfncfen opened this issue Nov 24, 2016 · 3 comments

Comments

@pfncfen
Copy link

pfncfen commented Nov 24, 2016

After git cloning your repo, I tried npm run dev. Below is the result:

image

I've searched github and I found this
https://github.com/gaearon/react-hot-loader/blob/master/docs/Troubleshooting.md

Cannot resolve 'file' or 'directory' react/lib/ReactMount

If you're using a precompiled React instead of react npm package, React Hot Loader configuration will need a few tweaks. See Usage with External React.

Make sure you have '.js' in resolve.extensions section of Webpack config, or Webpack won't be able to find any JS files without explicitly specifying extension in require.

According to this, I deleted the react-hot-loader related code in the webpack.dev.js and the whole thing started to functioning again. However I had to give up react-hot-loader which is very useful in my development.

I was thinking that is it because the version of react-hot-loader is out of date so that some function is depracated and the whole thing just crashed down?
If u know the answer, please reply ASAP. Thx.

@pfncfen
Copy link
Author

pfncfen commented Nov 24, 2016

@lcxfs1991
Copy link
Member

Hi @pfncfen. Thank u for your response. I am at Singapore preparing for a sharing. I would take a look at it at weekends. I would be also appreciated if u can fix the problem. Thanks again!

@pfncfen
Copy link
Author

pfncfen commented Nov 25, 2016

Hi @lcxfs1991. Thank u for ur reply. The answer to this question simply lies in my reference
gaearon/react-hot-loader#417

Adding alias: { 'react/lib/ReactMount': 'react-dom/lib/ReactMount' } to your webpack config fixes this for now.

I've tried this, and it worked out. But the author of React-Hot-Loader strongly advised us to upgrade from v1.3.0 to v3.x so maybe it's time to take a look into this.

@pfncfen pfncfen closed this as completed Nov 25, 2016
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