From 9927a735d667b6ba1247d10a3679e273a5329242 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Fri, 10 Nov 2023 13:54:25 +0100 Subject: [PATCH] Handle uncaught dynamic import errors in Webpack loader A dynamic import may fail for various reasons. This was unhandled. This means the loader could wait indefinitely. Now it defers the error to Webpack. --- packages/loader/index.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/loader/index.cjs b/packages/loader/index.cjs index af2e7913a..eab55a2da 100644 --- a/packages/loader/index.cjs +++ b/packages/loader/index.cjs @@ -28,5 +28,5 @@ function loader(code) { // Note that `import()` caches, so this should be fast enough. import('./lib/index.js').then((module) => { return module.loader.call(this, code, callback) - }) + }, callback) }