diff --git a/lib/AsyncDependencyToInitialChunkError.js b/lib/AsyncDependencyToInitialChunkError.js index 570eb51cd17..75888f869a3 100644 --- a/lib/AsyncDependencyToInitialChunkError.js +++ b/lib/AsyncDependencyToInitialChunkError.js @@ -25,8 +25,6 @@ class AsyncDependencyToInitialChunkError extends WebpackError { this.name = "AsyncDependencyToInitialChunkError"; this.module = module; this.loc = loc; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/CaseSensitiveModulesWarning.js b/lib/CaseSensitiveModulesWarning.js index 2650c1dfaee..8ccc682bf37 100644 --- a/lib/CaseSensitiveModulesWarning.js +++ b/lib/CaseSensitiveModulesWarning.js @@ -65,8 +65,6 @@ ${modulesList}`); this.name = "CaseSensitiveModulesWarning"; this.module = sortedModules[0]; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/ChunkRenderError.js b/lib/ChunkRenderError.js index d7e03714fc5..fce913f171a 100644 --- a/lib/ChunkRenderError.js +++ b/lib/ChunkRenderError.js @@ -25,8 +25,6 @@ class ChunkRenderError extends WebpackError { this.details = error.stack; this.file = file; this.chunk = chunk; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/CodeGenerationError.js b/lib/CodeGenerationError.js index 144afe0eed1..b1cf51d744e 100644 --- a/lib/CodeGenerationError.js +++ b/lib/CodeGenerationError.js @@ -23,8 +23,6 @@ class CodeGenerationError extends WebpackError { this.message = error.message; this.details = error.stack; this.module = module; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/CommentCompilationWarning.js b/lib/CommentCompilationWarning.js index 7aa47c763b8..335992f9fd5 100644 --- a/lib/CommentCompilationWarning.js +++ b/lib/CommentCompilationWarning.js @@ -22,8 +22,6 @@ class CommentCompilationWarning extends WebpackError { this.name = "CommentCompilationWarning"; this.loc = loc; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/ConcurrentCompilationError.js b/lib/ConcurrentCompilationError.js index ccb28516d2e..3643553f050 100644 --- a/lib/ConcurrentCompilationError.js +++ b/lib/ConcurrentCompilationError.js @@ -14,7 +14,5 @@ module.exports = class ConcurrentCompilationError extends WebpackError { this.name = "ConcurrentCompilationError"; this.message = "You ran Webpack twice. Each instance only supports a single concurrent compilation at a time."; - - Error.captureStackTrace(this, this.constructor); } }; diff --git a/lib/DllReferencePlugin.js b/lib/DllReferencePlugin.js index cb1116f7b3d..5effddb3f55 100644 --- a/lib/DllReferencePlugin.js +++ b/lib/DllReferencePlugin.js @@ -156,8 +156,6 @@ class DllManifestError extends WebpackError { this.name = "DllManifestError"; this.message = `Dll manifest ${filename}\n${message}`; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/HarmonyLinkingError.js b/lib/HarmonyLinkingError.js index 0d6d08310b2..8259beca634 100644 --- a/lib/HarmonyLinkingError.js +++ b/lib/HarmonyLinkingError.js @@ -12,7 +12,5 @@ module.exports = class HarmonyLinkingError extends WebpackError { super(message); this.name = "HarmonyLinkingError"; this.hideStack = true; - - Error.captureStackTrace(this, this.constructor); } }; diff --git a/lib/HookWebpackError.js b/lib/HookWebpackError.js index 0dce256f9cb..e813d1eac87 100644 --- a/lib/HookWebpackError.js +++ b/lib/HookWebpackError.js @@ -32,7 +32,6 @@ class HookWebpackError extends WebpackError { this.hideStack = true; this.details = `caused by plugins in ${hook}\n${error.stack}`; - Error.captureStackTrace(this, this.constructor); this.stack += `\n-- inner error --\n${error.stack}`; } } diff --git a/lib/InvalidDependenciesModuleWarning.js b/lib/InvalidDependenciesModuleWarning.js index 74a4e2ea63d..a69eed58d92 100644 --- a/lib/InvalidDependenciesModuleWarning.js +++ b/lib/InvalidDependenciesModuleWarning.js @@ -33,8 +33,6 @@ ${depsList.slice(0, 3).join("\n")}${ this.name = "InvalidDependenciesModuleWarning"; this.details = depsList.slice(3).join("\n"); this.module = module; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/ModuleBuildError.js b/lib/ModuleBuildError.js index 887db5950c5..a91d7857939 100644 --- a/lib/ModuleBuildError.js +++ b/lib/ModuleBuildError.js @@ -53,8 +53,6 @@ class ModuleBuildError extends WebpackError { this.name = "ModuleBuildError"; this.details = details; this.error = err; - - Error.captureStackTrace(this, this.constructor); } serialize(context) { diff --git a/lib/ModuleDependencyError.js b/lib/ModuleDependencyError.js index aeeeb859dc1..416a6357d0c 100644 --- a/lib/ModuleDependencyError.js +++ b/lib/ModuleDependencyError.js @@ -30,8 +30,6 @@ class ModuleDependencyError extends WebpackError { /** error is not (de)serialized, so it might be undefined after deserialization */ this.error = err; - Error.captureStackTrace(this, this.constructor); - if (err && /** @type {any} */ (err).hideStack) { this.stack = err.stack.split("\n").slice(1).join("\n") + "\n\n" + this.stack; diff --git a/lib/ModuleDependencyWarning.js b/lib/ModuleDependencyWarning.js index 9246cfe0258..f22a5825b4f 100644 --- a/lib/ModuleDependencyWarning.js +++ b/lib/ModuleDependencyWarning.js @@ -30,8 +30,6 @@ class ModuleDependencyWarning extends WebpackError { /** error is not (de)serialized, so it might be undefined after deserialization */ this.error = err; - Error.captureStackTrace(this, this.constructor); - if (err && /** @type {any} */ (err).hideStack) { this.stack = err.stack.split("\n").slice(1).join("\n") + "\n\n" + this.stack; diff --git a/lib/ModuleError.js b/lib/ModuleError.js index 7da05d316b2..d6a17cae481 100644 --- a/lib/ModuleError.js +++ b/lib/ModuleError.js @@ -37,8 +37,6 @@ class ModuleError extends WebpackError { err && typeof err === "object" && err.stack ? cleanUp(err.stack, this.message) : undefined; - - Error.captureStackTrace(this, this.constructor); } serialize(context) { diff --git a/lib/ModuleNotFoundError.js b/lib/ModuleNotFoundError.js index 1daf31dcd5c..a8f14b1e538 100644 --- a/lib/ModuleNotFoundError.js +++ b/lib/ModuleNotFoundError.js @@ -80,8 +80,6 @@ class ModuleNotFoundError extends WebpackError { this.module = module; this.error = err; this.loc = loc; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/ModuleParseError.js b/lib/ModuleParseError.js index 8743b101f9a..2a54f1bef6f 100644 --- a/lib/ModuleParseError.js +++ b/lib/ModuleParseError.js @@ -85,8 +85,6 @@ class ModuleParseError extends WebpackError { this.name = "ModuleParseError"; this.loc = loc; this.error = err; - - Error.captureStackTrace(this, this.constructor); } serialize(context) { diff --git a/lib/ModuleRestoreError.js b/lib/ModuleRestoreError.js index e42591e49ab..cf21a938aca 100644 --- a/lib/ModuleRestoreError.js +++ b/lib/ModuleRestoreError.js @@ -36,8 +36,6 @@ class ModuleRestoreError extends WebpackError { this.details = details; this.module = module; this.error = err; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/ModuleStoreError.js b/lib/ModuleStoreError.js index 6d81e22b74f..9d1f66b5413 100644 --- a/lib/ModuleStoreError.js +++ b/lib/ModuleStoreError.js @@ -36,8 +36,6 @@ class ModuleStoreError extends WebpackError { this.details = details; this.module = module; this.error = err; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/ModuleWarning.js b/lib/ModuleWarning.js index a663d638153..a67c0e06f44 100644 --- a/lib/ModuleWarning.js +++ b/lib/ModuleWarning.js @@ -37,8 +37,6 @@ class ModuleWarning extends WebpackError { warning && typeof warning === "object" && warning.stack ? cleanUp(warning.stack, this.message) : undefined; - - Error.captureStackTrace(this, this.constructor); } serialize(context) { diff --git a/lib/NoModeWarning.js b/lib/NoModeWarning.js index 8a82f72f70e..fdd3fadf9c6 100644 --- a/lib/NoModeWarning.js +++ b/lib/NoModeWarning.js @@ -18,7 +18,5 @@ module.exports = class NoModeWarning extends WebpackError { "Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\n" + "You can also set it to 'none' to disable any default behavior. " + "Learn more: https://webpack.js.org/configuration/mode/"; - - Error.captureStackTrace(this, this.constructor); } }; diff --git a/lib/NormalModule.js b/lib/NormalModule.js index f1ad9990a5b..fca226e1b5d 100644 --- a/lib/NormalModule.js +++ b/lib/NormalModule.js @@ -164,8 +164,6 @@ class NonErrorEmittedError extends WebpackError { this.name = "NonErrorEmittedError"; this.message = "(Emitted value instead of an instance of Error) " + error; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/UnsupportedFeatureWarning.js b/lib/UnsupportedFeatureWarning.js index 67f670dab1c..2c59f4a80a8 100644 --- a/lib/UnsupportedFeatureWarning.js +++ b/lib/UnsupportedFeatureWarning.js @@ -21,8 +21,6 @@ class UnsupportedFeatureWarning extends WebpackError { this.name = "UnsupportedFeatureWarning"; this.loc = loc; this.hideStack = true; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/WarnDeprecatedOptionPlugin.js b/lib/WarnDeprecatedOptionPlugin.js index 518e33455b3..dfb86a1950d 100644 --- a/lib/WarnDeprecatedOptionPlugin.js +++ b/lib/WarnDeprecatedOptionPlugin.js @@ -48,8 +48,6 @@ class DeprecatedOptionWarning extends WebpackError { "configuration\n" + `The value '${value}' for option '${option}' is deprecated. ` + `Use '${suggestion}' instead.`; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/WebpackError.js b/lib/WebpackError.js index 9b972e8f8f6..b98ad5a2e20 100644 --- a/lib/WebpackError.js +++ b/lib/WebpackError.js @@ -31,8 +31,6 @@ class WebpackError extends Error { this.chunk = undefined; /** @type {string} */ this.file = undefined; - - Error.captureStackTrace(this, this.constructor); } [inspect]() { diff --git a/lib/dependencies/CriticalDependencyWarning.js b/lib/dependencies/CriticalDependencyWarning.js index e1026d9c1f4..4501e6868ad 100644 --- a/lib/dependencies/CriticalDependencyWarning.js +++ b/lib/dependencies/CriticalDependencyWarning.js @@ -14,8 +14,6 @@ class CriticalDependencyWarning extends WebpackError { this.name = "CriticalDependencyWarning"; this.message = "Critical dependency: " + message; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/dependencies/RequireIncludeDependencyParserPlugin.js b/lib/dependencies/RequireIncludeDependencyParserPlugin.js index b33a8dfe289..d74db996c62 100644 --- a/lib/dependencies/RequireIncludeDependencyParserPlugin.js +++ b/lib/dependencies/RequireIncludeDependencyParserPlugin.js @@ -67,8 +67,6 @@ class RequireIncludeDeprecationWarning extends WebpackError { this.name = "RequireIncludeDeprecationWarning"; this.loc = loc; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/dependencies/SystemPlugin.js b/lib/dependencies/SystemPlugin.js index b3243968fa8..4b5648c9b5c 100644 --- a/lib/dependencies/SystemPlugin.js +++ b/lib/dependencies/SystemPlugin.js @@ -127,8 +127,6 @@ class SystemImportDeprecationWarning extends WebpackError { this.name = "SystemImportDeprecationWarning"; this.loc = loc; - - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/errors/BuildCycleError.js b/lib/errors/BuildCycleError.js index 20203e5fcbf..a235fcebbe4 100644 --- a/lib/errors/BuildCycleError.js +++ b/lib/errors/BuildCycleError.js @@ -21,7 +21,6 @@ class BuildCycleError extends WebpackError { this.name = "BuildCycleError"; this.module = module; - Error.captureStackTrace(this, this.constructor); } } diff --git a/lib/performance/AssetsOverSizeLimitWarning.js b/lib/performance/AssetsOverSizeLimitWarning.js index bdce0692d04..5b414fc0dfd 100644 --- a/lib/performance/AssetsOverSizeLimitWarning.js +++ b/lib/performance/AssetsOverSizeLimitWarning.js @@ -28,7 +28,5 @@ Assets: ${assetLists}`); this.name = "AssetsOverSizeLimitWarning"; this.assets = assetsOverSizeLimit; - - Error.captureStackTrace(this, this.constructor); } }; diff --git a/lib/performance/EntrypointsOverSizeLimitWarning.js b/lib/performance/EntrypointsOverSizeLimitWarning.js index 93dd72e8edc..270e8aaa708 100644 --- a/lib/performance/EntrypointsOverSizeLimitWarning.js +++ b/lib/performance/EntrypointsOverSizeLimitWarning.js @@ -31,7 +31,5 @@ Entrypoints:${entrypointList}\n`); this.name = "EntrypointsOverSizeLimitWarning"; this.entrypoints = entrypoints; - - Error.captureStackTrace(this, this.constructor); } }; diff --git a/lib/performance/NoAsyncChunksWarning.js b/lib/performance/NoAsyncChunksWarning.js index 15ebc68006a..a7319d5950b 100644 --- a/lib/performance/NoAsyncChunksWarning.js +++ b/lib/performance/NoAsyncChunksWarning.js @@ -16,7 +16,5 @@ module.exports = class NoAsyncChunksWarning extends WebpackError { ); this.name = "NoAsyncChunksWarning"; - - Error.captureStackTrace(this, this.constructor); } }; diff --git a/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js b/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js index 9a4076aa70d..5174862ca5c 100644 --- a/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +++ b/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js @@ -12,7 +12,5 @@ module.exports = class UnsupportedWebAssemblyFeatureError extends WebpackError { super(message); this.name = "UnsupportedWebAssemblyFeatureError"; this.hideStack = true; - - Error.captureStackTrace(this, this.constructor); } }; diff --git a/lib/wasm-sync/WebAssemblyInInitialChunkError.js b/lib/wasm-sync/WebAssemblyInInitialChunkError.js index 106b5dfb16c..9d78ed205f4 100644 --- a/lib/wasm-sync/WebAssemblyInInitialChunkError.js +++ b/lib/wasm-sync/WebAssemblyInInitialChunkError.js @@ -102,7 +102,5 @@ ${moduleChains.map(s => `* ${s}`).join("\n")}`; this.name = "WebAssemblyInInitialChunkError"; this.hideStack = true; this.module = module; - - Error.captureStackTrace(this, this.constructor); } };