I am having consistency issues with the require function in dojo 1.8 when it is run after the page has loaded.
For instance, when I dynamicaly update a node on a webpage (portlets in this case) the content is received in JSON, which is sucessfully parsed and inserted inside the webpage. If it contains any script tags they are also successfully executed however, when the require function is called it sometimes, 50-60% of the time, fails to download its dependencies and reports a timeout error in the dojoloader. What’s even more strange is that I see no requests initiated for the dependencies the loader reported as “timed out”.

This only happens when it is called after the page has finished loading as I do not have any problem of this kind with scripts present at page load.
I’ve also noticed that when I purposefully make the server response slow (500ms sleep) it is never able to download the dependencies (The timeout is around 5 seconds so that shouldn’t be a problem right?)
I’ve been experiencing this issue in Chrome, Firefox and IE9 (where it miserably always fails) and it is driving me mad as I cannot figure out why this is happening…
Thank you for any help provided.
A script tag generated by ASP MVC inside a declaratively set
dijit/MenuItemwas causing the problem.These two do not mix well together…