38

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.

1 Answer 1

68

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..
  },
Sign up to request clarification or add additional context in comments.

3 Comments

Is it possible to Simulate requirejs's load timeout error? Without using a throttling proxy or anything fancy like that?
@Kumar, just create custom loader plugin like that: define([], function(resource_name, require, load, config){setTimeout(function(){load({})}, 1000}); and load it using "module!".
@kumar_harsh (for fellow googlers) Chrome has an integrated low bandwith simulation mode. Look for it in dev tools.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.