-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
[bug] Problems of using react-addons-perf #6949
Comments
@joseph1125 can you share a JSFiddle reproducing the issue? You can use https://jsfiddle.net/reactjs/69z2wepo/ as a base. |
Yeah, fairly sure this is a duplicate. The fix will be out in the next patch release. |
@gaearon What's the status of this in I'm getting results back from
Here is the code: https://gist.github.com/nathanmarks/a284a8c9a8c926bcd79c7a2a93427dbc And here is a fiddle which reproduces the warning (same component above converted to |
Interesting. Generally we haven't tested ReactPerf in this scenario much. It is primarily meant to be used from browser console, not from a wrapping component. We should support this scenario better. If it's not fixed in 15.2.0 it's probably a bug. Can you send a PR that adds similar case as a failing test to |
@nathanmarks Can you please check if your |
@gaearon Looks good on my end, warning is gone. Awesome 👍 |
I think all of the cases related to this should be solved in 15.2.1. |
I don't know if it is the same issue, but with 15.2.1 I just got
It happened after I added this minimal code to a working boilerplate kit:
and added Edit: it goes away when instead I use
But still the error is confusing. |
@jdelafon There’s a ton of code there. I would rather avoid spending 15 minutes setting it up just to discover I can’t reproduce the issue. Would you mind extracting the relevant part that produces the warning as a separate GitHub project or a JSFiddle so I could inspect it? |
This warning is also shown when something |
Unfortunately I can't reproduce it with minimal case. Probably there's something wrong in my setup :-( |
Check if you have duplicate React in the bundle (maybe some component contains a copy in its own |
I experienced this issue first thing while trying out gaearon/todos:
|
Experiencing this one too
|
It is hard for us to isolate the problem without knowing where this warning comes from. It seems that ReactDebugTool is catching all kinds of errors, especially in |
There are no try-catch statements there. What likely happens is that you might have a Promise polyfill than doesn’t log its unhandled rejections. Therefore errors thrown inside
Please provide exact steps to reproduce it. I cloned the project, ran To reiterate: I’m happy to reopen if this is a real issue but I can’t help without a project reproducing it. |
@gaearon I managed to reproduce it in in const mapStateToProps = (state) => {
return {
todos: getVisiblesTodos(state.todos, state.visibilityFilter), // typo creates a reference error
};
}; Result:
|
Just as an additional note -- I realise that this isn't hiding the message, but I personally haven't been able to reproduce this in a manner which completely hides the error message. I haven't got this problem in my own application except when using HMR + react hot loader. In my own app, if I create a reference error in render and let it get hot reloaded, I get this error (HMR gives me the reference error). But if I do a complete refresh, I just see an unhandled in promise error in my console. |
Yeah, I'm not sure how to completely mask the error with this. By the way, is the perf tools warning intended to fire under these circumstances? |
This looks like correct behavior to me. The error is printed but it gets React into an inconsistent state. |
Let’s reopen because we should definitely make this more user-friendly. |
Rephrasing is a good option. It's certainly correct behaviour given what happens, but the current message could be confusing to some. One thing I haven't been able to reproduce is masking the original error. @jdelafon can you shed any light on how to reproduce this? |
Apparently I did not notice the real error after the warning (I reproduced my example above and saw |
Rephrasing seems like a good idea. I started seeing errors like this after upgrading to 15.2.1:
I see now this is thrown anytime I have an error in one of my components (which happens frequently during development) but thought there was an additional problem due to the wording of the message. |
Got it. I think it was my mistake to enable this by default. We should change it to only be active in tests. I’ll get back to this soon. |
I have the same error with 15.3.0 .. Warning: There is an internal error in the React performance measurement code. Did not expect componentDidMount timer to start while render timer |
Thanks for your comment, but this doesn’t help diagnose the issue in any way. Please read the comments above. There are two situations in which you can get this warning:
Thanks! |
For anyone searching and finding this thread, I saw this warning when losing to a race condition arising from dispatching an async action in |
hey @tayiorbeii could you expand on this? I think I've got the same problem but not sure what I should be looking for... |
Hey @patrickgordon, it's funny how long ago 9 days seems. I wish would I have been more clear in my previous comment. As I recall, my problem was along these lines:
The issue was I just looking at So in short, not a React issue. Look around your code for late night slip ups like that. |
Fixed via #7548. This will be out in the next release. |
Fixed in 15.3.2. |
Got the pls report as a bug request in my console, and here I am. using 15.4.1 Warning appears when I use <iframe>. There is a web audio object (as a component) as the children of that frame. Above the frame, there is static DOM. |
@Norm- can you share a small test case reproducing the issue? You can use https://jsfiddle.net/reactjs/69z2wepo/ as a starting point |
I probably should've investigated more before I made the comment. It was a mistake on my part. There was actually a TypeError before that React warning. I use a web audio object inside an iframe. When the component (the only stateful one) holding the frame updates, the iframe component gets a new key, thus unmounts and a fresh Frame component is rendered. The audio lib I am using (howler) requires that it should be initialized with an array of strings. I passed it I can still reproduce it, if you want, but it would be broken code. |
A reproducing case would still be nice because I wouldn't expect this warning even if code throws after this fix. |
I seem to have found another instance of this warning. It's triggered by a null reference inside a react-toolbox Dialog (similar to react-portal) child method. I built a test-case. It's not as minimal as I would like, but I wasn't able to recreate the bug in a couple hours in jsfiddle without react-toolbox. |
At this point it’s unlikely we’ll spend time fixing it, as we’re working on a rewrite that doesn’t include this addon. That said if you find an easy fix please send a PR. |
When trying to use react-addons-perf@15.1.0 in Google Chrome, it is found that after Perf.start(), error messages displayed
Warning: There is an internal error in the React performance measurement code. Did not expect ctor timer to start while componentDidMount timer is still in progress for another instance.
Warning: There is an internal error in the React performance measurement code. We did not expect componentDidMount timer to stop while no timer is still in progress for another instance. Please report this as a bug in React.
After I typed Perf.stop() and try to use getWasted - this error message displayed
ReactPerf.js:239 Uncaught TypeError: Cannot read property 'updateCount' of undefined(…)
The text was updated successfully, but these errors were encountered: