aurelia - Aurelia TypeError: this.sourceExpression.connect is not a function
问题描述
I have encountered runtime error:
TypeError: this.sourceExpression.connect is not a function
Problem is that stacktrace does not show anything useful, it points (randomly) to the last line of one of bundled components (in this case Leaflet's MarkerClusterGroup):
Uncaught TypeError: this.sourceExpression.connect is not a function at ChildInterpolationBinding.connect (MarkerClusterGroup.Refresh.js:110) at enqueueBindingConnect (MarkerClusterGroup.Refresh.js:110) at ChildInterpolationBinding.bind (MarkerClusterGroup.Refresh.js:110) at View.bind (MarkerClusterGroup.Refresh.js:110) at If._show (MarkerClusterGroup.Refresh.js:110) at If._update (MarkerClusterGroup.Refresh.js:110) at If.conditionChanged (MarkerClusterGroup.Refresh.js:110) at BehaviorPropertyObserver.selfSubscriber (MarkerClusterGroup.Refresh.js:110) at BehaviorPropertyObserver.call (MarkerClusterGroup.Refresh.js:110) at BehaviorPropertyObserver.setValue (MarkerClusterGroup.Refresh.js:110) at If.descriptor.set [as condition] (MarkerClusterGroup.Refresh.js:110) at Object.setValue (MarkerClusterGroup.Refresh.js:110) at Binding.updateTarget (MarkerClusterGroup.Refresh.js:110) at Binding.call (MarkerClusterGroup.Refresh.js:110) at BehaviorPropertyObserver.callSubscribers (MarkerClusterGroup.Refresh.js:110) at BehaviorPropertyObserver.call (MarkerClusterGroup.Refresh.js:110)
解决方案
Cause of the issue was not related with file where stack trace was pointing to. Issue was syntax error (double dot: dto..firstName) in binding expression in one of Aurelia templates, something like:
<input value.bind="dto..firstName" />
Template had no relation or dependency to line of code (or even JS library) where stack trace was pointing to.
推荐阅读
- c++ - net-snmp v2c 运行良好,但 v3 返回 STAT_ERROR
- javascript - 在循环中更改侦听器 - 只有第一个有效
- android - Android Studio 中的多用户使用 Realtime Firebase
- java - 如何通过java8将列表转换为地图?
- chart.js - 下载后如何包含 Chart.js 的头文件?
- azure - 使用 AWS Route 53 将 A 记录更改为 CNAME 传播
- javascript - 测试是否引发了 ValidationError 。奥多 14
- c# - 无法通过使用泛型从 B 转换为 A < X >
- excel - 将信息添加到 Excel 文件
- angular - 在 docker 容器中运行“ng build”会给出“找不到项目定义”