       Router.NotFoundRoute {handler: NotFoundComponent}
 
   # TODO handle errors, timeouts
-  Modules.init_modules(module_names).finally ->
-    React.renderComponent routesComponent, target
-  .done()
+  initializationPromise = Modules.init_modules(module_names)
+
+  React.renderComponent routesComponent, target
+  initializationPromise.done()
 
 exports.raw_cell_url = (value) ->
   # TODO don't require appComponent

    appComponent = @

    modal = @state.modal
    if @props.bodyWrapper
      body = @props.bodyWrapper null, @props.activeRouteHandler()
    else
      body = @props.activeRouteHandler()
    React.DOM.div {className: 'lead'},
      React.DOM.div {className: 'nav-bar'},
        Router.Link {to: 'notebook', className: 'title'}, 'lead'

      if @props.footer
        React.DOM.div {className: 'modal-footer'}, @props.footer

initializationPromise = null
AppComponent = React.createClass
  displayName: 'AppComponent'
  getInitialState: ->
    initializationPromise.finally =>
      @setState initializationState: initializationPromise.inspect()
    modal: null
    initializationState: initializationPromise.inspect()
  mixins: [Router.Navigation]
  componentWillMount: ->
    modalModel.onValue (modals) =>
