Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to debugging zone issues #1048

matthewp opened this Issue Nov 2, 2017 · 1 comment


None yet
1 participant
Copy link

commented Nov 2, 2017

This issue seeks to improve the debugging experience when you encounter zone related issues.

This was discussed on a recent live stream (1:01:09)

The Problem

When a donejs application doesn't complete loading in the browser it can be a head-scratching experience. The application might appear done, the UI is there (from ssr) but you can't interact with this. This is often caused by the fact that rendering did not complete within done-autorender's zone.

The Solution

We see that most of these issues happen when using done-autorender in the client; most issues don't occur within server rendering where debugging and timeout options already exist.

can-zone/debug: break on timeout

The default behavior of the debug zone is to provide a list of stack traces for things that have not completed by the time the timeout occurs. This helps narrow down to a few functions that have not completed. What would also be useful would be to have the ability to set a debugger; breakpoint when asynchronous code is called after the timeout is completed. It could work like this:

var timeout = require("can-zone/timeout");
var debug = require("can-zone/debug");

var timeoutZone = timeout(5000);
var debugZone = debug(timeoutZone, { break: true });

new Zone([
  timeoutZone, debugZone

Include a timeout and debug information in done-autorender

Currently done-autorender does not include the timeout or debug zones. It makes sense to include the timeout zone, and the debug zone, at least for development. Both are fairly small and don't add much weight, and in the case of debug zone I think we would make it development only.

We could also allow some flag that enables the break on timeout behavior that we add to can-zone:

<script src="./node_modules/steal/steal.js" main="app/index.stache!done-autorender"

Would enable the break on timeout option in the debug zone. Otherwise it would just dump the stack traces when the timeout occurs.


@matthewp matthewp added the enhancement label Nov 2, 2017

@justinbmeyer justinbmeyer referenced this issue Nov 3, 2017


Epoch 1 Survey Questions #77

24 of 24 tasks complete

@matthewp matthewp added the Epic label Nov 16, 2017


This comment has been minimized.

Copy link
Contributor Author

commented Jan 18, 2018

This was completed some time ago.

@matthewp matthewp closed this Jan 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.