{"id":20821,"library":"webpack-retry-chunk-load-plugin","title":"webpack-retry-chunk-load-plugin","description":"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.","status":"active","version":"3.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/mattlewis92/webpack-retry-chunk-load-plugin","tags":["javascript","webpack","webpack plugin","typescript"],"install":[{"cmd":"npm install webpack-retry-chunk-load-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-retry-chunk-load-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-retry-chunk-load-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Webpack 5+ is required as a peer dependency for plugin integration.","package":"webpack","optional":false}],"imports":[{"note":"Named import is correct; the plugin is exported as a named member. CommonJS require works if not using ESM.","wrong":"const RetryChunkLoadPlugin = require('webpack-retry-chunk-load-plugin')","symbol":"RetryChunkLoadPlugin","correct":"import { RetryChunkLoadPlugin } from 'webpack-retry-chunk-load-plugin'"}],"quickstart":{"code":"const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin');\n\nmodule.exports = {\n  plugins: [\n    new RetryChunkLoadPlugin({\n      maxRetries: 3,\n      retryDelay: 1000,\n      cacheBust: `function() { return Date.now(); }`,\n      lastResortScript: \"window.location.href='/500.html';\",\n    }),\n  ],\n};","lang":"javascript","description":"Shows how to require and instantiate the plugin in a webpack config with common options."},"warnings":[{"fix":"Upgrade to webpack 5 or stay on v1.x for webpack 4.","message":"Version 2.0.0 dropped webpack 4 support; only webpack 5+ is compatible.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Use a string like `function() { return Date.now(); }` instead of just `Date.now()`.","message":"The cacheBust option must be a stringified function expression, not a plain string.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure your chunk splitting is configured correctly for async chunks.","message":"The plugin only retries loading of chunks that failed; it does not affect initial bundle loading.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pass a string like \"window.location.href='/error'\" instead of a function.","message":"The lastResortScript option must be a string of JavaScript code, not a function reference.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install webpack-retry-chunk-load-plugin --save-dev`","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'webpack-retry-chunk-load-plugin'"},{"fix":"Use `import { RetryChunkLoadPlugin } from 'webpack-retry-chunk-load-plugin'` or require with destructuring.","cause":"Default import used incorrectly; plugin is a named export.","error":"TypeError: RetryChunkLoadPlugin is not a constructor"},{"fix":"Either upgrade to webpack 5 or use v1.x of the plugin.","cause":"Using v2+ of the plugin with webpack 4.","error":"Error: webpack version 4.x is not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}