1

I had a trivial Durandal app working, paused to prototype a capability in an html page related only by the fact that it resides in the same folder, and then returned to the Durandal app only to find that while the shell is constructing the menu, views don't seem to load or at least render. The # url changes but that's it.

I've previously seen this when I had broken JS in a view or in shell.js, but I've tried stripping the routing table down to the home view which is basically static html with an empty view, and it's still happening.

The question is not so much "why are my app views showing blank" as "how does one go about troubleshooting this". There's no barfing, just a white silence. I'm not fond of guessing games and I can't believe a framework so well thought out lacks a strategy for troubleshooting.

Yes, I've seen the http://durandaljs.com/documentation/Debugging.html page. Debugging is switched on in my main.js but I don't know how to proceed from here.

So, where does one normally start when this happens? Some logging seems in order but I have no idea where to put it.

I marked the applicationHost div like so

<div id="applicationHost">
  <div style="margin: 100px;">Hello, I haven't been replaced yet.</div>
</div>

and it vanishes right after shell calls router.activate()

OK, I found the specific problem, it was a bad binding in shell.html - the name of a binding target changed and the binding needs to be updated.

But the question of how to find this stuff remains. My app is trivially simple. "Inspect everything and hope you notice any problems" is not going to work on a complex app.

In the absence of any advice I'm starting to think that the only available strategy is to make only incremental changes with constant regression testing.

Peter Wone
  • 17,965
  • 12
  • 82
  • 134
  • I know this may sound obvious but you do use Chrome or FF debugging tools dont you? (Press F12) Throughout my developments, the deubg info is gospel to me and im not sure how i would develop JS apps without it. – Jamie Hammond Mar 11 '14 at 17:01
  • Yes, also IE F12 tools. I think I'm starting to see a pattern - when *everything* goes blank I've mucked up shell data binding otherwise it's a particular view with bad binding. In hindsight this should have been obvious from the fact that stripping the routing table didn't change the behaviour. – Peter Wone Mar 11 '14 at 21:58
  • Yep, generally I get routing errors and binding errors and you become familiar with the messages that are displayed in the console. It took me a while to get the hang of it but now i have no problems. I generally use the chrome debugging tool. – Jamie Hammond Mar 12 '14 at 17:16

0 Answers0