Skip to content

Commit 3f183b5

Browse files
authored
Merge pull request webpack#7210 from gluecodes/master
fix: ReferenceError: onScriptComplete is not defined when using HMR o…
2 parents ae6c7a4 + 9791c0b commit 3f183b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/web/JsonpMainTemplatePlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ class JsonpMainTemplatePlugin {
173173
"onScriptComplete({ type: 'timeout', target: script });"
174174
]),
175175
`}, ${chunkLoadTimeout});`,
176-
"script.onerror = script.onload = onScriptComplete;",
177176
"function onScriptComplete(event) {",
178177
Template.indent([
179178
"// avoid mem leaks in IE.",
@@ -196,7 +195,8 @@ class JsonpMainTemplatePlugin {
196195
]),
197196
"}"
198197
]),
199-
"};"
198+
"};",
199+
"script.onerror = script.onload = onScriptComplete;"
200200
]);
201201
}
202202
);

0 commit comments

Comments
 (0)