partytown
partytown copied to clipboard
Error finding instance and failed analytics report bug
We have an app that is server side rendered (Node express and Handlebars) and has Google tag manager and Google analytics reports in it. We are trying to add partytown to improve our Lighthouse score and performance. We have a reverse proxy via Nginx.
We are having two problems right now
-
Sometimes the Partytown errors out with something unknown I don't understand why and when this happens but when it does it means the whole service worker does not really work at all. I think maybe this is some race condition because I sometimes get it sometimes I don't? Screenshot
-
when partytown does load but the collect is a bit weird We have one that is failing and the other two are marked as not completed and also one of them has all the dataLayer variables as undefined Screenshots
Version "builder.io/partytown": "^0.6.0"
We need a way to reproduce the issue otherwise there is not much we can do. Please provide a simple reproduction.
Related: https://github.com/BuilderIO/partytown/issues/72, having the same issue btw
Thanks @royduin I will look at that issue and see if any insight on a solution pops up @mhevery , we have put that task of integrating partytwon aside for a few sprints and now are back to it, sorry for not being responsive on that. Im not sure what else data you need for reproducing, I am not sure what the cause for this error is so I was not able to actually setup any working reproduction of this error, if there any missing data on the stack/setup that we have that can help is missing please let me know and I will supply
As much as we would like to help, we need reproduction steps to dig into what is going on, screenshots are not enough. Without seeing the error on our machines, there is not much we can do.
As for #72; just install GTM and try to debug with https://tagassistant.google.com
Hi folks, even I am facing the same issue in preview mode.
Error message is Error finding instance "1wxccpy1m7t.d" on window 2
Here is the site for reproducing the issue: https://github.com/SujayPrabhu96/integrate-gatsby-google-tagmanager-using-partytown
Env needs to be set is:
GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID
@mhevery Is there any update on this issue ?
I have the same issue with Nuxt3. Is there any solution?
For us this happens when switching between tabs (some of our internal links open a new tab), I wonder if the Service Worker doesn't correctly deal with multiple tabs and tracking which window belongs where?
I think the instance ID is wrongfully created with 1
again, instead of 2
, yet the worker expects the right one:
If I'm not mistaken, that should say "Created top window 2 environment", because this is the 2nd window the worker is running in.
Can I ask for a PR with tests showing the failure to simplify our reproduction of the issue. https://github.com/BuilderIO/partytown/blob/main/tests/integrations/gtm/index.html
I ran into this error when I'm trying to run Tag Assistant. I can kind of reproduce this error (looks similar) by running current test suite and adding some gtm_debug
query param, not sure if that's enough information.
http://localhost:4000/tests/integrations/gtm/?gtm_debug=1698689697661
I want to debug this but honestly I don't know where to start.
Can I ask for a PR with tests showing the failure to simplify our reproduction of the issue. https://github.com/BuilderIO/partytown/blob/main/tests/integrations/gtm/index.html
I believe there might be multiple issues going on here.
The GTM Preview issues are well described by @slawekkolodziej in #72 along with his solution and contribution - thank you @slawekkolodziej!
Underlying though, the $instanceId$ not found
errors (Error finding instance "2dab62yogpr.d" on window 2
in debug build) appear to be an issue when multiple tabs/pages are open and service workers are involved (problems do not seem to occur when atomics are used). I created #492 since I'm easily able to reproduce the issue without GTM.
@mhevery - #493 contains a PR with tests and #492 describes how to manually reproduce as well - thank you!
Hi @sthobis, Have you resolved the issue? I am also facing the same issue
data-pterror="Error: 25p416vnd9f.d not found at $e (blob:https://{host}/7aed8ded-2e59-4659-8c85-59aefdd3be9c:2:5065)
I'm also facing this issue when switching tabs. Is there any update or has anyone found a workaround?
I'm also facing this issue when switching tabs. @jjpaulino found something?
@MichelAraujo @jjpaulino @mhevery I've added the fix here
@vladetsky -
This is great, thank you! I had created #492 which is a simplified version of the multiple tabs
issue given this issue (#202) is related to GTM and the core issue has nothing to do with GTM (as evidenced by your fixes in #573). I can't recall exactly why I added more tests beyond just platform\multiple-pages but I'm sure there was a reason. Possibly we should merge the tests in #493 in to your #573 to provide broader coverage for this issue, especially around integrations?