Skip to content

Commit

Permalink
Handle uncaught dynamic import errors in Webpack loader
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
remcohaszing committed Nov 10, 2023
1 parent efeb479 commit 9927a73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/loader/index.cjs
Expand Up @@ -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)
}

0 comments on commit 9927a73

Please sign in to comment.