Load timeout for modules
jmarrec opened this issue · 3 comments
Hi,
First, I really like your extension, it's really useful when editing large IPython notebooks to navigate efficiently.
The problem is that with large Ipython notebooks, I'm getting a timeout error on one of my machines (the slowest of the two, and only on the biggest notebook I have).
Opening up the firefox dev console, I can see the following error:
"Failed to load extension(s):" Array [ "nbextensions/gist", "nbextensions/toc" ] Error: Load timeout for modules: nbextensions/gist,nbextensions/toc
http://requirejs.org/docs/errors.html#timeout
Stack trace:
makeError@http://localhost:8888/static/components/requirejs/require.js?v=640929dac3c23a448d2eebc37bc32062:166:17
checkLoaded@http://localhost:8888/static/components/requirejs/require.js?v=640929dac3c23a448d2eebc37bc32062:692:23
checkLoaded/checkLoadedTimeoutId<@http://localhost:8888/static/components/requirejs/require.js?v=640929dac3c23a448d2eebc37bc32062:713:25
It is indeed a proper timeout error as far as I can tell since it only happens on large notebooks, and if I keep refreshing the page eventually it will succeed (I'm probably very close to the time limitation).
requireJS has a 7 second default (documentation here). Apparently one can configure waitSeconds to any value (including 0 for unlimited). That's what I'd like to do, but I'm completely illiterate in javascript/jquery.
From what I understand from this page I'd have to create an app.js with the requirejs.config stuff and the call to your toc.js and then setup my custom.js to load app.js instead of toc.js?
Any idea if there's a better or easier way?
Thank you, and keep up the good work
I've tried to modify the toc.js to add at the top the waitSeconds property
require.config({
waitSeconds: 120,
});
define(["require", "jquery", "base/js/namespace"], function (require, $, IPython) {
"use strict";
var make_link = function (h) {
var a = $("<a/>");
a.attr("href", '#' + h.attr('id'));
// get the text *excluding* the link text, whatever it may be
etc
But this isn't working, I'm clearly not doing it right. Any idea?
I figured out how to change it for all modules, not sure if there's a way to overwrite waitSeconds just for the toc.js
Anyways, you have to change it in require.js itself, if you're using Anaconda it's in Anaconda\Lib\site-packages\IPython\html\static\components\requirejs\require.js
then locate waitSeconds
and change the value to something greater than 7
@jmarrec Thanks, I was having the same problem with IPython-notebook-extensions, and setting waitSeconds = 0
in IPython's require.js
file fixed it. (On Linux, require.js
is in the anaconda3/lib/python3.4/site-packages/IPython/html/static/components/requirejs/
folder).
Maybe it's worth submitting a bug report to IPython?