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
- docs(guides): clarify some caveats about dynamic import manual preload via script tag webpack/webpack/issues/14874 — committed to artem-malko/webpack.js.org by artem-malko 2 years ago
- docs(guides): clarify some caveats about dynamic import manual preloa… (#5960) * docs(guides): clarify some caveats about dynamic import manual preload via script tag webpack/webpack/issues/14874 ... — committed to webpack/webpack.js.org by artem-malko 2 years ago
- Merge sync 0bca7e3 (#809) * build(deps-dev): bump sass from 1.46.0 to 1.47.0 (#5854) Bumps [sass](https://github.com/sass/dart-sass) from 1.46.0 to 1.47.0. - [Release notes](https://github.com/sa... — committed to line/webpack.kr by dkstyle 2 years ago
- Merge sync 4b5c747 (#849) * docs(configuration): fix `stats.context` info and example (#5880) * build(deps-dev): bump @babel/preset-env from 7.16.8 to 7.16.10 (#5892) Bumps [@babel/preset-env](... — committed to line/webpack.kr by dkstyle 2 years ago
- Merge sync a82e284 (#896) * build(deps-dev): bump @babel/core from 7.17.2 to 7.17.3 (#5971) Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.17.2 to 7.17.3.... — committed to line/webpack.kr by dkstyle 2 years ago
@alexander-akait https://github.com/webpack/webpack.js.org/pull/5960 pull-request is ready)
@sokra up) We need your opinion)
@artem-malko Let’s wait @sokra answer too, maybe we will have other ideas too