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

Problems updating to React 15.4.0 #8302

Closed
albertolive opened this issue Nov 16, 2016 · 5 comments
Closed

Problems updating to React 15.4.0 #8302

albertolive opened this issue Nov 16, 2016 · 5 comments

Comments

@albertolive
Copy link

I'm getting this error with in all my files:

Module not found: Error: Cannot resolve module 'react/lib/ReactMount' in...

I'm using the latest version of react: 15.4.0.

webpack: 1.12.11

Any help?

@gaearon
Copy link
Collaborator

gaearon commented Nov 16, 2016

Hi, thanks for the report.

You need to find the library that imports react/lib/ReactMount and file an issue with it.
This was never officially supported, as noted in the release notes:

However, there is a possibility that you imported private APIs from react/lib/*, or that a package you rely on might use them. We would like to remind you that this was never supported, and that your apps should not rely on internal APIs. The React internals will keep changing as we work to make React better.

We warned about this change a month ago so most libraries that reached into the internal APIs could be updated.

This issue is not actionable for us so I will close it. Webpack should print the name of the module that tried to import react/lib/ReactMount, so you should be able to tell which library's fault it is. Then you can file an issue with it.

As a temporary fix that library could start importing react-dom/lib/ReactMount instead, but this is also guaranteed to break in the future. We never supported, and will not support reaching into internal modules.

@hhope1271
Copy link

We never supported, and will not support reaching into internal modules.

@gaearon From what I can tell, that require is coming from react-hot-loader v1.3.0, which is the latest non-beta release according to: https://github.com/gaearon/react-hot-loader/releases.

prependText = [
    '/* REACT HOT LOADER */',
    'if (module.hot) {',
      '(function () {',
        'var ReactHotAPI = require(' + JSON.stringify(require.resolve('react-hot-api')) + '),',
            'RootInstanceProvider = require(' + JSON.stringify(require.resolve('./RootInstanceProvider')) + '),',
            'ReactMount = require("react/lib/ReactMount"),',
            'React = require("react");',

        'module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () {',
          'return RootInstanceProvider.getRootInstances(ReactMount);',
        '}, React);',
      '})();',
    '}',
    'try {',
      '(function () {',
  ].join(' ');

@gaearon
Copy link
Collaborator

gaearon commented Nov 16, 2016

React Hot Loader 1.x has been unsupported for about a year by now. Please use 3.x which should work without reaching into internal modules.

@hhope1271
Copy link

Hey @gaearon , fair enough. Thanks! Might be off-topic, but will there be an official stable release of 3.x in the near future? To be fair I did miss the documentation where it mentioned the requirement to use 3.x, but it still feels a bit unintuitive to be forced to use a pre-release/beta version.

@gaearon
Copy link
Collaborator

gaearon commented Nov 16, 2016

Please reach out to project maintainers about this. I can't say because I'm not actively involved right now.

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

3 participants