#1855·requirejs

Timeout issue thrown when fetching modules

Author: t-vinayCreated May 17, 2024Updated Sep 22, 2024

We are loading a module dynamically at the run time, using require. This module's HTML and JS file were being downloaded properly, along with the other dependent JS files. But in recent times (after some stack uptake), we see are seeing a new "intermittent" issue of time gap of ~24 seconds between the html file and the last request to the server. The JS file was downloaded first and all its dependencies. But after a gap 24 seconds, then the request for the html was sent and it resulted in : .../3rdparty/require/require.js 4:1794 Uncaught Error: Load timeout for modules: text!views/monitoring.html https://requirejs.org/docs/errors.html#timeout

We did check the server side logs and access logs and we don't see any request during that 24 seconds. There was no operation during that time and still the require module didn't send the request to the server.

As mentioned earlier, this is intermittent for now but we are seeing it consistently after few runs (especially after stack uptake). Ideally, stack uptake should not have affected this since there is no change in the UI code.

Questions:

  1. What could be cause for require module not to send the request for nearly 24 seconds?
  2. How to debug this stalling issue on the client side inside the require module?
  3. Any possible workaround for this? We did set the timeout value to higher value, but still see this issue sometimes.

thanks, -Vinay