Closed tysonnero closed 7 years ago
The uid it's looking for (57) does not exist in node.cache. There uid's that are in cache are 62 and 66. One is the component which should be being loaded and the other is Connect.
As I dug in a little more, I found that this is happening after dispatching a redux action from the componentWillReceiveProps of the component. Not really sure what else to look for.
I move the dispatch out of componentWillReceiveProps to another area of the application, and the issue has gone away. Although fixed, I'm going to leave open to see if anyone can give me some insight into why this would have happened. Thanks!
I have this issue too
A quick glance at our code shows that none of our code is dispatching a redux action in the componentWillReceiveProps
lifecycle directly or indirectly.
I suppose the problem here https://github.com/Lucifier129/react-lite/commit/14c164b73490f3d9b576c6b9c3af32c434a45893#diff-33385622f0cbc5bbb7cd88879f6a81acR269
If component have componentWillReceiveProps
(like react-redux connect component) then updateVcomponent
function crash updater.isPending
flag. Even if updater.isPending
is true
always will be set to false
after this code
if (component.componentWillReceiveProps) {
updater.isPending = true
component.componentWillReceiveProps(nextProps, componentContext)
updater.isPending = false
}
As result updateVcomponent
may executed many many times when it should't.
When I remove updater.isPending = true
updater.isPending = false
it solve this issue.
Why it's necessary to toggle the flag if a component has componentWillReceiveProps
?
@beholderrk when updater.isPending === true
, component.setState
will not cause rendering directly, and setState in life-cycle method componentWillReceiveProps
should not cause rendering
pr #88
@beholderrk Thanks PR, it can be merged safely, and v0.15.29 now has been released;)
Uncaught TypeError: Cannot read property '$updater' of undefined
When I include the below in my webpack.config to use react-lite in place of react, I rec'ing the above error. When I remove react-lite, my app works as expected.
Is there any good way of debugging this?