# 4.3 Release - Linq Bindings FirstOrDefault 'TypeError'

**URL:** <https://forum.dotvvm.com/t/4-3-release-linq-bindings-firstordefault-typeerror/271>\
**Category:** Discussion in English\
**Created:** [October 9, 2024, 11:41am UTC](https://forum.dotvvm.com/t/4-3-release-linq-bindings-firstordefault-typeerror/271 "2024-10-09T11:41:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![benj989](https://forum.dotvvm.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@benj989](https://forum.dotvvm.com/u/benj989)\
**Post date:** [October 9, 2024, 11:41am UTC](https://forum.dotvvm.com/t/4-3-release-linq-bindings-firstordefault-typeerror/271/1 "2024-10-09T11:41:30Z")

</div>

Hi team,  
Since I updated my DotVVM packages to the latest 4.3.0 version along with DotVVM.Controls.Bootstrap4 to 4.3.0, I’m getting errors as shown in the console log below.

It happens when using a binding such as `Visible="{value: !MyList.FirstOrDefault(x => x.ID == SelectedID).SomeProperty}"`. This used to work fine before the update, is there something I need to change or update in my code?

I don’t see any compile time issues or any concerns from the ’ Compilation status page’. Any assistance would be greatly appreciated!

```auto
VM391:3 
Uncaught TypeError: MyList(...)?.find(...)?.SomeProperty is not a function
    at visible (eval at createBindingsStringEvaluator (knockout:3301:16), <anonymous>:3:130)
    at evaluateValueAccessor (knockout:3574:16)
    at knockout:3751:32
    at update (knockout:5628:47)
    at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout:3825:33)
    at Function.evaluateImmediate_CallReadThenEndDependencyDetection (knockout:2411:103)
    at Function.evaluateImmediate_CallReadWithDependencyDetection (knockout:2368:29)
    at Function.evaluateImmediate (knockout:2333:28)
    at Function.evaluatePossiblyAsync (knockout:2298:32)
    at Function.notifySubscribers (knockout:1456:38)
visible	@	VM391:3
evaluateValueAccessor	@	knockout:3574
(anonymous)	@	knockout:3751
update	@	knockout:5628
ko.dependentObservable.disposeWhenNodeIsRemoved	@	knockout:3825
evaluateImmediate_CallReadThenEndDependencyDetection	@	knockout:2411
evaluateImmediate_CallReadWithDependencyDetection	@	knockout:2368
evaluateImmediate	@	knockout:2333
evaluatePossiblyAsync	@	knockout:2298
notifySubscribers	@	knockout:1456
valueHasMutated	@	knockout:1709
observable	@	knockout:1672
writeValueToProperty	@	knockout:2984
(anonymous)	@	knockout:5520
run	@	knockout:80
valueUpdateHandler	@	knockout:5515
(anonymous)	@	knockout:5607
dispatch	@	jquery-3.6.1.min.js:2
y.handle	@	jquery-3.6.1.min.js:2

```

---

<div class="post-metadata">

**Author:** ![benj989](https://forum.dotvvm.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@benj989](https://forum.dotvvm.com/u/benj989)\
**Post date:** [October 14, 2024, 12:53pm UTC](https://forum.dotvvm.com/t/4-3-release-linq-bindings-firstordefault-typeerror/271/2 "2024-10-14T12:53:32Z")

</div>

I should just clarify that “SomeProperty” is a boolean type. It also fails with a similar message if I just have literally `TheValue = {{value: !MyList.FirstOrDefault(x => x.ID == SelectedID).SomeProperty}}` in my dothtml file, or if I explicitly compare to true/false the expression like `Visible="{value: !MyList.FirstOrDefault(x => x.ID == SelectedID).SomeProperty == false}"`.

---

<div class="post-metadata">

**Author:** ![exyi](https://forum.dotvvm.com/user_avatar/forum.dotvvm.com/exyi/32/9_2.png) [@exyi](https://forum.dotvvm.com/u/exyi)\
**Post date:** [October 16, 2024, 11:45am UTC](https://forum.dotvvm.com/t/4-3-release-linq-bindings-firstordefault-typeerror/271/3 "2024-10-16T11:45:49Z")

</div>

Hi! Thank you for the bug report, it is indeed a regression in the 4.3 release. I discovered there were related issues in more complex cases, such as `.Select(...).ToArray()[0]`, so it took me bit longer to fix. The fixes are coming either in [Fix ko.observable handling in Linq translations by exyi · Pull Request #1870 · riganti/dotvvm · GitHub](https://github.com/riganti/dotvvm/pull/1870), or [Hot fix for missing ko.unwrap in Linq Last,First,ElementAt translations by exyi · Pull Request #1871 · riganti/dotvvm · GitHub](https://github.com/riganti/dotvvm/pull/1871).

If you need a workaround, using `.Select(a => a)` before the FirstOrDefault will exploit the second bug to mitigate the first one and should run 😅

---

<div class="post-metadata">

**Author:** ![benj989](https://forum.dotvvm.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@benj989](https://forum.dotvvm.com/u/benj989)\
**Post date:** [October 18, 2024, 4:38am UTC](https://forum.dotvvm.com/t/4-3-release-linq-bindings-firstordefault-typeerror/271/4 "2024-10-18T04:38:06Z")

</div>

Ok look forward to the next update with the fix, thanks! For now, I’ve just downgraded to 4.2 and that’s working all fine.

---

<div class="post-metadata">

**Author:** ![exyi](https://forum.dotvvm.com/user_avatar/forum.dotvvm.com/exyi/32/9_2.png) [@exyi](https://forum.dotvvm.com/u/exyi)\
**Post date:** [October 27, 2024, 3:26pm UTC](https://forum.dotvvm.com/t/4-3-release-linq-bindings-firstordefault-typeerror/271/5 "2024-10-27T15:26:50Z")

</div>

Hi! The [4.3.2](https://www.nuget.org/packages/DotVVM/4.3.2) version should have this fixed.
