partytown
partytown copied to clipboard
Deprecated APIs in use (GTM)
Hi folks,
I'm using Partytown on a Next.JS project for running Google Tag Manager. This works great, however, recently, lighthouse started reporting the following error:
Also, I'm getting this report on Chrome's DevTools.
This error only happens when I use Partytown + Google Tag Manager. Using GTM script directly on the main thread does not trigger this error. I tried to see if we use this API on partytown but could not find anything.
Anyone with any clue on this error? Thanks!
I am seeing the same issue using next.js implementation for GTM
The error seemed to disappear if i set the headers to use atomics
@jasonRufus I'm having the same problem with an application in gatsby. How did you enable this setting in atomics?
Sorry seems i was mistaken, i have retested and the same error occurs when using atomics. @MarlonPassos-git but to answer your question, your site needs to be cross origin isolated. you do this by adding these 2 response headers: Cross-Origin-Embedder-Policy: credentialless Cross-Origin-Opener-Policy: same-origin Partytown will automatically use atomics if set. See more here: https://partytown.builder.io/atomics#document-response-headers
@jasonRufus Chrome is talking about deprecating that API won't it be better to switch to using the alternate Event.computedPath()
API
Plus, it seems there is polyfill available.
if (!Event.prototype.path) {
Object.defineProperty(Event.prototype, 'path', {
get() { return this.composedPath(); }
});
}
+1 on this issue. Is there another solution that wouldn't involve setting headers?