You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applying an array producer on a third level depth produces an invalid state.
On the codesandbox repro, the arrayProducer is used at second and third level depth.
On state.array, it produces the expected result.
When applied on state.substate.array, the produced array is broken.
Accessing the produced array show the following error, rendering it unusable : Cannot perform 'get' on a proxy that has been revoked
the modified element is still correctly modified
the array length is still 2
the second array element seems to be null in console
Expected behavior
Producers should work without issues when nested.
Environment
Was working fine in old code (1.X).
Brokes when updating immer to 5.X.
Seems to works in codesandbox up to 4.0.0-beta.0
Immer version: 5.3.2
Occurs with setUseProxies(true)
Occurs with setUseProxies(false) (ES5 only)
The text was updated successfully, but these errors were encountered:
🐛 Bug Report
Updating an array in a substate produces an unusable object : reusing the produced object results in an error about proxy.
Link to repro
See tests in : https://codesandbox.io/s/minimal-repro-p6r9s
(Note : codesandbox typescript version is 3.6.2, resulting in warnings with Draft<> for immer 5.3.2)
To Reproduce
Observed behavior
Applying an array producer on a third level depth produces an invalid state.
On the codesandbox repro, the
arrayProducer
is used at second and third level depth.On
state.array
, it produces the expected result.When applied on
state.substate.array
, the produced array is broken.Cannot perform 'get' on a proxy that has been revoked
null
in consoleExpected behavior
Producers should work without issues when nested.
Environment
Was working fine in old code (1.X).
Brokes when updating immer to 5.X.
Seems to works in codesandbox up to 4.0.0-beta.0
setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: