I’m working on a large project with many developers. We have 2 pages using knockout that have been working for a while now. Some new, unrelated code was introduced and come to find out the 2 pages with Knockout no longer work properly. When the pages load, there’s an error thrown like below. A little investigating lead me to think there’s some kind parsing issue going on in the data-bind attributes. I’ve tried many things to get it working, but I keep getting the entire view model object returned whenever I try to access an observable property. I think this is what’s causing the error I’m seeing below after the page loads.
It’s very difficult for me to put examples in here so what I’m looking for is any advice on finding errors JavaScript and/or HTML mark-up that might be causing Knockout to fail.
<error>
(anonymous function)
r.Oa.v
r.i.q
r.a.n
e
h
f
r.R.fn.notifySubscribers
r.a.n
r.R.fn.notifySubscribers
r.w.b.G
b
Array.indexOf
r.a.k
r.T.Ha
b
PriceFormatted.ko.dependentObservable.read
h
f
r.R.fn.notifySubscribers
r.a.n
r.R.fn.notifySubscribers
r.w.b.G
b
Array.indexOf
r.a.k
r.T.Ha
b
// it keeps going from here...
Just wanted to update the answer for this. Unfortunately I didn’t track down exactly what the issue was, but it had to do with rearranging the order of referenced script files in the Master page of the app. I reverted back to the original order and the issue went away so it’s in fact related to a bigger issue of poorly written custom JavaScript throughout the app.