Roblox / roact

A view management library for Roblox Lua similar to React
https://roblox.github.io/roact
Apache License 2.0
562 stars 143 forks source link

Reconciler: attempt to index field '_instance' (a nil value) #1

Closed LPGhatguy closed 6 years ago

LPGhatguy commented 6 years ago

Not a very useful stack trace:

15:34:58.326 - ReplicatedStorage.GraphemeVisualizer.Rodux.NoYield:26: ReplicatedStorage.GraphemeVisualizer.Roact.Reconciler:327: attempt to index field '_instance' (a nil value)
15:34:58.326 - Stack Begin
15:34:58.327 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.NoYield', Line 13 - upvalue resultHandler
15:34:58.327 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.NoYield', Line 26 - upvalue NoYield
15:34:58.328 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.Store', Line 105 - method flush
15:34:58.328 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.Store', Line 43
15:34:58.329 - Stack End

Removing Reconciler.teardown's attempt to sever the circular reference between instances and instance handles fixes the issue.

LPGhatguy commented 6 years ago

Managed to get a better stack trace by turning off Rodux's NoYield -- need to do something about that function, since it ruins stack traces all the time:

11:06:40.010 - ReplicatedStorage.GraphemeVisualizer.Roact.Reconciler:327: attempt to index field '_instance' (a nil value)
11:06:40.011 - Stack Begin
11:06:40.011 - Script 'ReplicatedStorage.GraphemeVisualizer.Roact.Reconciler', Line 327 - field _reconcile
11:06:40.011 - Script 'ReplicatedStorage.GraphemeVisualizer.Roact.Component', Line 156 - method _forceUpdate
11:06:40.012 - Script 'ReplicatedStorage.GraphemeVisualizer.Roact.Component', Line 127 - method _update
11:06:40.013 - Script 'ReplicatedStorage.GraphemeVisualizer.Roact.Component', Line 114 - method setState
11:06:40.014 - Script 'ReplicatedStorage.GraphemeVisualizer.RoactRodux', Line 93 - local listener
11:06:40.014 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.Signal', Line 63 - method fire
11:06:40.014 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.Store', Line 106 - local c
11:06:40.014 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.NoYield', Line 29 - upvalue NoYield
11:06:40.015 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.Store', Line 105 - method flush
11:06:40.015 - Script 'ReplicatedStorage.GraphemeVisualizer.Rodux.Store', Line 43
11:06:40.015 - Stack End
LPGhatguy commented 6 years ago

This is a bug from Rodux's signal, nice.

https://github.com/Roblox/Rodux/commit/e922cbcd24ae15e1387a42b8ccd477a2e160322c