How to change module timeout in Require.js?

denysonique picture denysonique · Jan 24, 2013 · Viewed 26.6k times · Source

When I am on slow mobile broadband I sometimes get:

Uncaught Error: Load timeout for modules: goog!maps,3,other_params:sensor=false_unnormalized2,goog!maps,3,other_params:sensor=false,async!http://www.google.com/jsapi

I would like to raise the timeout for similar users as me sometimes using mbb.

Answer

ddotsenko picture ddotsenko · Jan 25, 2013

See waitSeconds config value from RequireJS docs:

http://requirejs.org/docs/api.html#config-waitSeconds

Per the docs, the default is 7 seconds. You can set it in your require.config call like this:

require.config( { 
  waitSeconds : 30,
  paths : {
      //etc..
  },