Open jhonatantft opened 2 years ago
Similar issue but different problem: https://github.com/BuilderIO/partytown/issues/38
Thanks, we are running a bit behind right now with a related project. Is this still an issue?
Yes, it is @mhevery
Are you able to debug which API is crashing? What's the code running before this error happens?
Hey, just wanted to confirm whether the open bug is related to the issue I'm facing while integrating Partytown in my React Application.
I'm getting non stop errors getting printed in console causing my app to crash.
It's mainly due to my app not being able to find the third party scripts since I changed their type to text/partytown
.
The errors are mostly like: Uncaught TypeError: Cannot read properties of undefined (reading 'then')
, TypeError: Cannot read properties of undefined (reading 'apply')
, etc.
I included the following script at top after loading partytown in public/
directory.
<script src="~partytown/partytown.js"></script>
@AkshayKumar007 I just had that issue where I was forwarding both datalayer and fbq events, however, I wasn't loading the facebook tracking script, only GA. I would still says that's a bug though.
I've got partytown working almost flawlessly if not for this issue. For us, it's stemming from calling gtag
/window.gtag
, like gtag('config', ...options...)
or gtag('set', ...options...)
. Both gtag
& window.gtag
(just to be safe) are listed in the partytown forward array.
Same issue here:
I have used the "Copy Library Files" instructions in my NextJS application.
Then configured partytown like this, as i'm using google analytics, gtm and fb pixel in my app:
import { Partytown } from "@builder.io/partytown/react";
...
<Partytown
forward={["dataLayer.push", "fbq", "gtag"]}
resolveUrl={(url, location, type) => {
// ...
}
/>
Describe the bug I tried to integrate partytown to an ecommerce website (VTEX platform) following the HTML integration doc, and all the resources are being loaded but I'm getting this error that is preventing the code to be executed.
Partytown version "@builder.io/partytown": "^0.6.1"
Screenshots
Additional context
The code breaks because it tries to use the
Object.getPrototypeOf
with anundefined
type as you can see in the screenshot below. The methodreadOwnImplementation
from partytown-sandbox-sw.js tries to get the prototype but it does not have any validation before doing it, so it breaks. I highlighted the method in yellow and where the param is coming from.