webpack: chunkLoadTimeout has to be cleared, if a request for a chunk fails

Feature request

I’m not sure, is it a bug or a feature request. We have an option chunkLoadTimeout in output. Here is a link to the docs. chunkLoadTimeout is the Number of milliseconds before chunk request expires. But there is a problem, when a request fails.

Let’s imagine, that we have a retry for a dynamic import. If the request for a chunk failed with a 500 code (for example), webpack will wait 12000 ms by default before the retry will be executed, cause import-Promise won’t be resolved/rejected during chunkLoadTimeout.

What is the expected behavior?

timeout should be cleared

What is motivation or use case for adding/changing the behavior?

Retry is not working properly

How should this be implemented in your opinion?

Just clear timeout on an error event.

Are you willing to work on this yourself?

Yeap, if it is ok for the core team)

So, there is an idea to clearTimeout, if the request failed. What do you think?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@sokra up) We need your opinion)

@artem-malko Let’s wait @sokra answer too, maybe we will have other ideas too