-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Error: Cannot find module 'react-dom/lib/ReactPerf' from 'react/lib/ReactAddonsDOMDependencies.js' #8556
Comments
I got it working using If I can provide any more info, please ask. |
Have you updated all React-related packages to |
This is everything that installs as a react component:
Tbh, I don't know what is core and what isn't :/ |
Can you please publish a standalone repo with instructions to reproduce this? |
The problem is probably with your use of react-form-elements@0.3.3, which depends on react@0.13.3. You are installing two versions of React, one of which is incompatible with the installed version of react-dom. |
Well, whadya know! Thanks. I'm intrigued however to understand how a component that isn't using the form elements (it wasn't being used yet, that was next on my list), would cause this failure? NPM and Node are still a little confusing to me. |
It's hard to tell what exactly is happening without a repository demonstrating the issue. |
Sadly it's private and I'm under pressure to get it done. When I do, I'll get an example put together asap. Thanks for your help guys. |
I spoke too soon. Had a clear-out of |
Maybe you're using a custom npm registry that's broken, or your npm cache is invalid? So somehow you have an old version of it. |
I'll close as the error is demonstrably caused by a wrong npm package or a bundler. |
As I said in the initial comment, I know it exists. That's what's confusing about it.
|
Yea, I’m not trying to argue with you, just pointing out it’s unactionable for us so no use keeping it open. If you figure out what’s happening please post a comment 😉 . If you don’t, but manage to find some time to share a project demonstrating it I’d be happy to dive in too. Cheers! |
No I know, I just thought as there was an issue already about that file going missing from older builds, it may be tangibly related. Things I've just tried:
Here is a test repo: https://github.com/designermonkey/react-issue |
Thanks for reproducing case, this is very helpful. It is either a Brunch bug or an issue with packaging. It’s hard to guess for now but I’ll leave this open until we confirm either. |
Thanks man. |
I can confirm that running brunch build --production: problem goes away. Probably a brunch BUG? |
Seams that this is a brunch issue. Check out this thread brunch/brunch#1591 |
The problem with brunch is conditional require. There are Notes for CommonJS at the official requirejs website. Check out this qoute:
brunch author @paulmillr also wrote:
So, what do you think about it guys? |
React has had a (different) conditional require since 15.2.0, see #6830. |
@gaearon after some digging into it, I found that the special problem here is the fact, that ReactAddonsDOMDependencies is inside react/lib and ReactPerf & ReactTestUtils are inside react-dom/lib I did some naive experiment by moving the conditional requires into Basically what I did..
But I haven't created a PR because there were some dozen tests which were failing. |
Maybe the comment above will bring some value to the brunch maintainers to fix it on the brunch / deppack side. |
I'm not sure this is because of that conditional require: brunch/brunch#1591 (comment). |
See facebook#8556 and brunch/brunch#1591 (comment) for context. This appears to be a Brunch bug but we can keep a temporary fix until the next major.
See facebook#8556 and brunch/brunch#1591 (comment) for context. This appears to be a Brunch bug but we can keep a temporary fix until the next major.
* Add manual build fixtures * Inject ReactDOM into ReactWithAddons from ReactWithAddons We used to read ReactDOM as a global inside ReactAddonsDOMDependenciesUMDShim. This didn't work in AMD environments such as RequireJS and SystemJS. Instead, I changed it so that ReactDOM gets injected into ReactWithAddons by ReactDOM itself. This way we don't have to try to require it (which wouldn't work because AMD doesn't handle circular dependencies well). This means you have to load ReactDOM first before using ReactDOM-dependent addons, but this was already the case before. This commit makes all build fixtures pass. * Memoize ReactDOM to avoid going into require on every access * Add Brunch fixture * Inline requires to work around Brunch bug See #8556 and brunch/brunch#1591 (comment) for context. This appears to be a Brunch bug but we can keep a temporary fix until the next major.
Should be temporarily fixed by #8686 and will be out in 15.4.2 (to be released soon). |
* Add manual build fixtures * Inject ReactDOM into ReactWithAddons from ReactWithAddons We used to read ReactDOM as a global inside ReactAddonsDOMDependenciesUMDShim. This didn't work in AMD environments such as RequireJS and SystemJS. Instead, I changed it so that ReactDOM gets injected into ReactWithAddons by ReactDOM itself. This way we don't have to try to require it (which wouldn't work because AMD doesn't handle circular dependencies well). This means you have to load ReactDOM first before using ReactDOM-dependent addons, but this was already the case before. This commit makes all build fixtures pass. * Memoize ReactDOM to avoid going into require on every access * Add Brunch fixture * Inline requires to work around Brunch bug See #8556 and brunch/brunch#1591 (comment) for context. This appears to be a Brunch bug but we can keep a temporary fix until the next major. (cherry picked from commit ca2c71c)
Should be fixed after updating all React packages to 15.4.2. |
Thanks guys! |
React 16.0.0 |
React 16 does not currently support the React Perf addon. Please read the 16 announcement blog post that mentions this. |
ReactAddonsDOMDependencies.js:29Uncaught Error: Cannot find module 'react-dom/lib/ReactPerf' from 'react/lib/ReactAddonsDOMDependencies.js'
I spotted that there was an issue with 15.4.1 regarding something like this, but this file exists. Brunch builds OK, but then fails in the browser with this error.
I don't know what version I was using prior to this where it worked :( I have tried 15.4.0 but still no luck.
The text was updated successfully, but these errors were encountered: