From f355ff68943a32e72ac84aa4c34d36ae4107032c Mon Sep 17 00:00:00 2001 From: Ludwig Schubert Date: Tue, 24 Oct 2017 16:51:17 -0700 Subject: [PATCH] ONly remove script tag if we find it in polyfills --- src/transforms/polyfills.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/transforms/polyfills.js b/src/transforms/polyfills.js index d4fb6c5..1a3fdea 100644 --- a/src/transforms/polyfills.js +++ b/src/transforms/polyfills.js @@ -50,7 +50,11 @@ window.addEventListener('WebComponentsReady', function() { export default function render(dom) { // pull out template script tag const templateTag = dom.querySelector('script[src*="template.v2.js"]'); - templateTag.parentNode.removeChild(templateTag); + if (templateTag) { + templateTag.parentNode.removeChild(templateTag); + } else { + console.info('FYI: Did not find template tag when trying to remove it. You may not have added it. Be aware that our polyfills will add it.') + } // add loader const loaderTag = dom.createElement('script');