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
patchComponent: Cannot read property '_unmounted' of null #895
Comments
I faced same error when investigated another task. Can you create simple steps to reproduce please. |
I am seeing same exception here also:
|
There is also third place where this fails instance being null, so somewhere its not setting instance correctly. |
Simple steps to reproduce needed... |
Well I have good news for you. I have successfully reproduced this and added test scenario for failing patch and unmount: 8eb679a the scenario is not that simple tho... lol |
@Havunen You are awesome! Our code that produces this issue is surrounding something relating to Mapbox. Some what complicated as well. |
This will be fixed in next release. Closing. |
@Havunen I have tested this with rc.9 and rc.10 and I still see the issue in both. |
@kanzelm3 okay, I need steps to reproduce it. |
Hello! This one reproduces in 1.3.1. |
@kirill-kruchkov I can re-open this, but last time I spent 2 full days trying to reproduce it and found one of scenarios when it happens, which is now fixed and tested for regression. If you can reproduce it again using different strategy I'm more than willing to fix it. But I need help reproducing this issue. |
I'm getting the same issue in 1.4 when dispatching actions from |
@OMLET can you share source code for that project or create minimal setup to reproduce it? |
@Havunen I'll try and write up a minimal setup. I did some minor testing using inferno redux, and found the following:
Below is a screenshot of what I see: In the store, I have a value named I'm not sure if this of any help. Again, I'll try and write up a setup for testing - the above is simply what I discovered in the main application. |
Okay thanks for update. Can you create external repository to reproduce it? |
Ok, I have found the root cause of the issue. I'll do my best to explain, but @OMLET is correct it is directly related to dispatching actions from within Let's say you have component A, a container component wrapped with the In some other child component of component A, a button is clicked that dispatches an action and causes component A to be patched. During the patch method it synchronously steps through each component in the tree and patches the component. Once it reaches component B, it calls the Inside The This is hard to explain, but I hope you understand what I am saying. If you have any questions please let me know and I can try to get a repo up that demonstrates the issue. In order to unit test this, you would have to either use the react-redux connect higher order component or create a HoC that does something similar to create the patch loop that causes the children instances to be null. |
ping @trueadm , How should we fix this? It sounds like |
I'm a little confused, |
I will work on it tonight, I had to take a break, my daughter's birthday party was today. You are correct that blockRender is set on the component that |
@kanzelm3 Ah, I see. Maybe we should introduce a sort of global blockRender effect and put it on |
Yeah that's what I was thinking, I just wasn't sure how feasible adding a global blockRender would be and wasn't sure where to start. |
Because if blockRender was set globally then any actions dispatched from |
I'd add a Remove it as a property This doesn't really have anything to do with sync vs async. In fact, in many ways this is an unintended side-effect that React should never have supported and in the future, with Fiber will likely go away in the form of a new API. |
@trueadm I dont think that will work... Wouldn't that mean all renders are blocked accross the board while one component got props? |
Btw we have faced same issue as described here in our company. Its also related to componentWillReceiveProps => do setState => raise callback => do setState there in parent component, and fail. |
I have verified this is not related to componentWillReceiveProps only but also componentWillUpdate (most likely all lifecycle events) |
I pushed few variations of test cases to dev to reproduce this issue. |
Good news this will be fixed in 1.5
|
@Havunen that's great news, looking forward to it and sorry I couldn't help more. |
Closing as 1.5 has been released! 👍 |
Hello. The issue seems to be back again starting v1.6 (also reproduced in 3.0.6) with error message "Uncaught TypeError: Cannot read property 'flags' of null" when dispatching redux actions from |
I'm getting the same problem as @kirill-kruchkov. Will look into... |
Also getting this problem. Seems to happen only when navigating from route to route for me. Happens even when I use the back button. I have an |
Observed Behaviour
Inferno is throwing and uncaught exception
Cannot read property '_unmounted' of null
. It is happening inside patchComponent whenlastVNode.children
isnull
. It is throwing becauseinstance._unmounted
is null to be more specific.inferno/packages/inferno/src/DOM/patching.ts
Line 289 in 8a605ab
Expected Current Behaviour
Inferno should not throw an uncaught exception, but should handle
null
as children appropriately.Inferno Metadata
Using inferno/inferno-compat v1.3.0-rc.8
macOS / Chrome
The text was updated successfully, but these errors were encountered: