Closed matthewoden closed 7 years ago
I guess it'd help to point out where I got the issue:
Console:
Uncaught Error: Cannot find module "react-dom/lib/ReactDOM" ReactAddonsDOMDependencies.js:13
Source Map:
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactDOM = require('react-dom/lib/ReactDOM'); // < -- this line right here errors out
var ReactInstanceMap = require('react-dom/lib/ReactInstanceMap');
exports.getReactDOM = function () {
return ReactDOM;
};
exports.getReactInstanceMap = function () {
return ReactInstanceMap;
};
if (process.env.NODE_ENV !== 'production') {
var ReactPerf = require('react-dom/lib/ReactPerf');
var ReactTestUtils = require('react-dom/lib/ReactTestUtils');
exports.getReactPerf = function () {
return ReactPerf;
};
exports.getReactTestUtils = function () {
return ReactTestUtils;
};
}
/*****************
** WEBPACK FOOTER
** ./~/react-stonecutter/~/react/lib/ReactAddonsDOMDependencies.js
** module id = 844
** module chunks = 0
**/```
And just to clarify - no stonecutter code is at fault here. This is just a sad side effect of react messing with itself across versions. If a project has 15.3 dependancies and react 15.4 dependancies, while on npm 2.x (still common for those of us on Node LTS), require resolutions start going haywire.
Hi, I'd like to help but I'm a little confused. I've updated my react and react-dom packages to 15.4.0
and everything is working in the demo. If I change from ^15.3.2
to ~15.3.2
this will not allow using the latest version of react with stonecutter. Surely I don't want that?
Can you not fix the version of react in your project to 15.3.2
, and this will still satisfy the stonecutter peer dependency? Sorry if I'm missing something.
So that's the weird thing - we DO use 15.3.2, and there's no peer dependency resolution happening. npm still installs stonecutter with react 15.4.0, and freaking out about missing /lib/ modules.
...Maybe I need to read a refresher on npm's dependency resolution.
And you're right - as a library, it'd actually be terrible to limit which react version you need. I suppose you could do some version patching to support react 15.3.X and react 15.4.X, but that's WAY more confusing for users than it is helpful.
For now, I suppose my best course of action is just forking stonecutter for our use until this 15.4 behavior stuff is resolved (or our apps all get up to speed with node 6 LTS, and we can use npm 3 for dependency management).
Thanks for the quick reply! I'll go ahead and close this.
React 15.4 changes the internals of
react
, andreact-dom
. For both of these dependancies, react-stonecutter uses^15.3.2
instead of~15.3.2
.Using
^
allows npm to skip up to the latest minor version, thus using react 15.4.0. If this dependency changed to~
, stonecutter would stop at 15.3.N, where N is the last published version of 15.3.(I'd love just make a pull request for what's basically a one-character change, but sadly I'm on a company-owned machine right now with all kinds of restrictions on open source stuff)