Closed lizryzhko closed 2 years ago
What browser are you receiving this error? Would you be able to create a minimal example to reproduce this? Thanks
@adamdbradley I'm getting a similar error. All browsers, Chrome, FF, Safari
I have it set up like this
<script>
partytown = {
lib: "/js/~partytown/",
debug: true,
forward: [['dataLayer', 1]],
logCalls: true,
logGetters: true,
logSetters: true,
logImageRequests: true,
logMainAccess: true,
logSendBeaconRequests: true,
logStackTraces: false,
logScriptExecution: true,
};
</script>
<script src="/js/~partytown/debug/partytown.js"></script>
<script type="text/partytown">
(function (window, document, i) {
window['dataLayer'] = window[dataLayer] || [];
window['dataLayer'].push({ 'gtm.start': new Date().getTime(), 'event': 'gtm.js' });
var firstScript = document.getElementsByTagName('script')[0];
var gtmScript = document.createElement('script');
var dataLayer = 'dataLayer' != 'dataLayer' ? '&l=' + 'dataLayer' : '';
gtmScript.async = true;
gtmScript.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dataLayer;
firstScript.parentNode.insertBefore(gtmScript, firstScript);
})(window, document, 'GTM-REDACTED');
</script>
And i'm getting this error:
url: https://www.googletagmanager.com/gtm.js?id=GTM-REDACTED TypeError: Cannot read properties of undefined (reading 'createElement')
at eval (eval at re (partytown-ww-sw.js:1), <anonymous>:36:242)
at eval (eval at re (partytown-ww-sw.js:1), <anonymous>:36:402)
at eval (eval at re (partytown-ww-sw.js:1), <anonymous>:37:271)
at eval (eval at re (partytown-ww-sw.js:1), <anonymous>:48:326)
at Proxy.eval (eval at re (partytown-ww-sw.js:1), <anonymous>:493:3)
at re (partytown-ww-sw.js:1)
at partytown-ww-sw.js:1
Hey! I'm getting a similar error. Help me please.
const doc = win.document;
const docImpl = doc.implementation.createHTMLDocument();
const elm = docImpl.createElement("i");
elm.constructor.name // returns 'b' but not 'HTMLElement'
elm.constructor - > ƒ (){return a.Reflect.construct(a.HTMLElement,[],this.constructor)}
but not
elm.constructor - > ƒ HTMLElement() { [native code] }
Why? I hope for your help. Thanks.
It conflicts with gpt.js:
<script src="//securepubads.g.doubleclick.net/tag/js/gpt.js" />
Any update on this? I am also receiving this error:
partytown-sandbox-sw.html?1646610283529:2 Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
at partytown-sandbox-sw.html?1646610283529:2:5241
at Array.map (<anonymous>)
at P (partytown-sandbox-sw.html?1646610283529:2:5191)
at partytown-sandbox-sw.html?1646610283529:2:6635
at Worker.W.onmessage (partytown-sandbox-sw.html?1646610283529:2:25463)
Hi. I just tried to use this library for the first time, got the error:
here
docImpl.createElement("i").constructor.name
returnsb
, andwin.b
isundefined
. 🤷♀️