From c27c2569cc7e218c2e6216fdc441db9aa4d82987 Mon Sep 17 00:00:00 2001 From: Jean Honlet Date: Fri, 13 Nov 2020 22:00:42 +0100 Subject: [PATCH] fix(middleware): catch errors when loading a module Fix karma-runner/karma#3572 --- lib/middleware/karma.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/middleware/karma.js b/lib/middleware/karma.js index c48332d12..cabeb2f81 100644 --- a/lib/middleware/karma.js +++ b/lib/middleware/karma.js @@ -193,7 +193,11 @@ function createKarmaMiddleware ( } else { const scriptType = (SCRIPT_TYPE[fileType] || 'text/javascript') const crossOriginAttribute = includeCrossOriginAttribute ? 'crossorigin="anonymous"' : '' - scriptTags.push(``) + if (fileType === 'module') { + scriptTags.push(``) + } else { + scriptTags.push(``) + } } }