Registry / web-framework / webpack-retry-chunk-load-plugin

webpack-retry-chunk-load-plugin

JSON →
library3.1.1jsnpmunverified

A webpack plugin that automatically retries loading of async chunks that fail to load. Version 3.1.1 supports webpack 5 or newer. It is actively maintained, with regular updates. Key features include configurable retry delay, maximum retries, chunk filtering, cache busting, and a last resort script. It provides TypeScript type declarations and is a drop-in solution compared to manual retry logic.

npm install webpack-retry-chunk-load-plugin
INSTALL
IMPORT
SIG · WEBPACK-RETRY-CHUN
W
webpack-retry-chunk-load-plugin
web-frameworkjavascriptv3.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RetryChunkLoadPlugin
import { RetryChunkLoadPlugin } from 'webpack-retry-chunk-load-plugin'
const RetryChunkLoadPlugin = require('webpack-retry-chunk-load-plugin')
Named import is correct; the plugin is exported as a named member. CommonJS require works if not using ESM.

Shows how to require and instantiate the plugin in a webpack config with common options.

const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin'); module.exports = { plugins: [ new RetryChunkLoadPlugin({ maxRetries: 3, retryDelay: 1000, cacheBust: `function() { return Date.now(); }`, lastResortScript: "window.location.href='/500.html';", }), ], };
Debug
Known issues
breakingVersion 2.0.0 dropped webpack 4 support; only webpack 5+ is compatible.
fix
Upgrade to webpack 5 or stay on v1.x for webpack 4.
affects: >=2.0.0 <3.0.0
gotchaThe cacheBust option must be a stringified function expression, not a plain string.
fix
Use a string like `function() { return Date.now(); }` instead of just `Date.now()`.
affects: >=1.0.0
gotchaThe plugin only retries loading of chunks that failed; it does not affect initial bundle loading.
fix
Ensure your chunk splitting is configured correctly for async chunks.
affects: >=1.0.0
gotchaThe lastResortScript option must be a string of JavaScript code, not a function reference.
fix
Pass a string like "window.location.href='/error'" instead of a function.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'webpack-retry-chunk-load-plugin'
Package not installed or missing from node_modules.
fix
Run `npm install webpack-retry-chunk-load-plugin --save-dev`
TypeError: RetryChunkLoadPlugin is not a constructor
Default import used incorrectly; plugin is a named export.
fix
Use `import { RetryChunkLoadPlugin } from 'webpack-retry-chunk-load-plugin'` or require with destructuring.
Error: webpack version 4.x is not supported
Using v2+ of the plugin with webpack 4.
fix
Either upgrade to webpack 5 or use v1.x of the plugin.
Upgrade
Version history
3.1.1latest on npm
Audit
Dependencies
webpackrequiredWebpack 5+ is required as a peer dependency for plugin integration.
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
webpack-retry-chunk-load-plugin — npm install webpack-retry-chunk-load-plugin · libregistry