Skip to content

Commit

Permalink
Add name property to error thrown on chunk load failure
Browse files Browse the repository at this point in the history
This allows to catch failed chunk loads
  • Loading branch information
felixfbecker authored and sokra committed Jun 12, 2019
1 parent 30882ca commit 7fb14ec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/web/JsonpMainTemplatePlugin.js
Expand Up @@ -188,6 +188,7 @@ class JsonpMainTemplatePlugin {
"var errorType = event && (event.type === 'load' ? 'missing' : event.type);",
"var realSrc = event && event.target && event.target.src;",
"error.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';",
"error.name = 'ChunkLoadError';",
"error.type = errorType;",
"error.request = realSrc;",
"chunk[1](error);"
Expand Down

0 comments on commit 7fb14ec

Please sign in to comment.