webpack
webpack Error Codes
Error types and codes produced by webpack 5 during module resolution, compilation, and runtime. They appear in the webpack stats output and as the type or code property on webpack Error objects.
8 codes
references webpack.js.org/api/stats/webpack.js.org/concepts/module-resolution/webpack.js.org/configuration/
· All codes 8 codes
- CHUNK_LOAD_ERROR Chunk Load Error A lazily-loaded code-split chunk failed to load in the browser at runtime. Caused by a network error, a stale CDN cache serving an old chunk hash, or the chunk file being missing from the server. The message reads 'Loading chunk N failed'. Hard-refresh the page; if the error persists in production, ensure the deployment atomically replaces all chunk files.
- CIRCULAR_DEPENDENCY Circular Dependency Two or more modules import each other in a cycle. webpack can still bundle circular dependencies but the evaluation order is undefined, which often results in a module being `undefined` when first accessed. Detected via the `circular-dependency-plugin`. Refactor the dependency cycle by extracting shared code into a third module.
- ENTRY_NOT_FOUND Entry Module Not Found The file specified as webpack's entry point does not exist. The message reads 'Entry module not found: Error: Can't resolve ...'. Check that the `entry` path in your webpack config points to an existing file and that the path is relative to the `context` option (default: the directory containing webpack.config.js).
- HMR_UPDATE_FAILED HMR Update Failed webpack's Hot Module Replacement could not apply a patch to the running application. This happens when the updated module or one of its ancestors cannot be hot-replaced (no `module.hot.accept` handler bubbles the change to the app root). The dev server falls back to a full page reload. To avoid the fallback, add `module.hot.accept()` boundaries around the module.
- INVALID_CONFIGURATION Invalid Configuration The webpack configuration object failed schema validation. The message names the offending property path and describes the expected type or allowed values. webpack validates the full config against a JSON Schema on startup; check the property path in the error and consult the webpack configuration documentation.
- LOADER_NOT_FOUND Loader Not Found A loader referenced in `module.rules` could not be resolved, typically because the loader package is not installed. The message reads 'Cannot find module ... loader'. Install the missing loader package via npm/yarn and verify the loader name is spelled correctly in the webpack config.
- MODULE_NOT_FOUND Module Not Found webpack could not resolve an import to a file on disk. The full message reads 'Module not found: Error: Can't resolve ...' and names the unresolvable specifier. Check that the package is installed, the path is spelled correctly, and that the `resolve.extensions` and `resolve.alias` config entries are correct.
- MODULE_PARSE_FAILED Module Parse Failed webpack's parser could not process a file, usually because it contains syntax that requires a loader (e.g. JSX, TypeScript, CSS). The message reads 'Module parse failed: Unexpected token' and suggests adding an appropriate loader. Add the relevant loader rule to `module.rules` in your webpack config.