From df1219b47a102e3d119fe8d86ecd4e5df15bf98f Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Thu, 2 May 2019 19:33:16 -0400 Subject: [PATCH] fixes #850, bundling external libraries was causing a callback to never be called (#1060) --- server/controllers/project.controller.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/controllers/project.controller.js b/server/controllers/project.controller.js index 41b240a0..07554787 100644 --- a/server/controllers/project.controller.js +++ b/server/controllers/project.controller.js @@ -255,6 +255,10 @@ function bundleExternalLibs(project, zip, callback) { if (!isUrl(src)) { numScriptsResolved += 1; + if (numScriptsResolved === numScriptTags) { + indexHtml.content = serializeDocument(document); + callback(); + } return; } @@ -281,6 +285,10 @@ function bundleExternalLibs(project, zip, callback) { for (let i = 0; i < numScriptTags; i += 1) { resolveScriptTagSrc(scriptTags[i], indexHtmlDoc); } + if (numScriptTags === 0) { + indexHtml.content = serializeDocument(document); + callback(); + } }); }