ember-deep-tracked icon indicating copy to clipboard operation
ember-deep-tracked copied to clipboard

Breaks when used with `array.includes`

Open amk221 opened this issue 2 years ago • 1 comments

Demo repo:

https://github.com/amk221/-ember-deep-tracked-include-issue/commit/b31a0870ef65cf707903104e9e98aac2f665bacc

Error output:

Uncaught TypeError: Cannot use 'in' operator to search for 'Symbol(TARGET)' in 2
    at unwrap (index.js:14:1060)
    at Array.map (<anonymous>)
    at Proxy.fn (index.js:11:474)
    at get hasFoo2 [as hasFoo2] (application.js:22:1)
    at getPossibleMandatoryProxyValue (index.js:1699:1)
    at _getProp (index.js:1723:1)
    at reference.js:175:1
    at reference.js:136:1
    at track (validator.js:635:1)
    at valueForRef (reference.js:135:1)
unwrap @ index.js:14
fn @ index.js:11
get hasFoo2 @ application.js:22
getPossibleMandatoryProxyValue @ index.js:1699
_getProp @ index.js:1723
(anonymous) @ reference.js:175
(anonymous) @ reference.js:136
track @ validator.js:635
valueForRef @ reference.js:135
(anonymous) @ runtime.js:3269
evaluate @ runtime.js:1052
evaluateSyscall @ runtime.js:4214
evaluateInner @ runtime.js:4185
evaluateOuter @ runtime.js:4178
next @ runtime.js:5009
_execute @ runtime.js:4996
execute @ runtime.js:4971
(anonymous) @ runtime.js:5054
runInTrackingTransaction @ validator.js:138
sync @ runtime.js:5054
(anonymous) @ index.js:4726
(anonymous) @ index.js:4695
(anonymous) @ index.js:4988
inTransaction @ runtime.js:4090
_renderRoots @ index.js:4970
_renderRootsTransaction @ index.js:5014
_renderRoot @ index.js:4959
_appendDefinition @ index.js:4884
appendOutletView @ index.js:4874
invoke @ backburner.js:284
flush @ backburner.js:197
flush @ backburner.js:360
_end @ backburner.js:801
end @ backburner.js:592
_run @ backburner.js:845
run @ backburner.js:627
run @ index.js:74
callback @ index.js:355

amk221 avatar Jul 27 '23 11:07 amk221

Thanks for the reproduction!

NullVoxPopuli avatar Jul 27 '23 12:07 NullVoxPopuli

Issue reproduced in the test suite: https://github.com/NullVoxPopuli/ember-deep-tracked/actions/runs/10713487671/job/29705582430?pr=357

NullVoxPopuli avatar Sep 05 '24 03:09 NullVoxPopuli

Sorry it took so long! I forgot about this. Will be fixed in the next release

NullVoxPopuli avatar Sep 05 '24 12:09 NullVoxPopuli