I’m developing a Shopify Web Pixel extension using the @shopify/web-pixels-extension package. My extension code is very simple and does not use alert anywhere. Here’s my main file:
import {register} from "@shopify/web-pixels-extension";
register(({ analytics, browser, init, settings }) => {
// Bootstrap and insert pixel script tag here
// Sample subscribe to page view
analytics.subscribe('page_viewed', (event) => {
console.log('Page viewed', event);
});
});
However, when I run my extension, I get the following error in the browser console:
Uncaught (in promise) ReferenceError: alert is not defined
at Object.<anonymous> (web-pixel-1027375272@013d4bc47cfee3b6f48ae6745405f09e.js:1:1062)
at Generator.next (<anonymous>)
at web-pixel-1027375272@013d4bc47cfee3b6f48ae6745405f09e.js:1:758
at new Promise (<anonymous>)
at a (web-pixel-1027375272@013d4bc47cfee3b6f48ae6745405f09e.js:1:578)
at Object.<anonymous> (web-pixel-1027375272@013d4bc47cfee3b6f48ae6745405f09e.js:1:924)
at J (worker.modern.js:1:66592)
at b (worker.modern.js:1:67987)
I have confirmed that there is no alert in my code. It seems to be coming from a bundled or third-party script, possibly a pixel or analytics script.
Also their are lots of other console which i am not console from anywhere.
The error ReferenceError: alert is not defined in a Shopify Web Pixel Extension is occurring because of how Web Pixels Manager handles third-party pixel code.
Looking at your screenshot, this error is coming from a third-party pixel that’s loaded on your shop - specifically from a file named web-pixel-1027375272@013d4bc47cfee3b6f48ae6745405f09e.js. This is not your extension code, but another app’s pixel trying to run on the same page.
The error occurs because the other app’s pixel is attempting to use the alert() function, which is not available in Web Workers (used by third-party app pixels).
In Web Workers, window-specific APIs like alert() are not available (they’re part of the Window interface). Therefore, pixels that run in Web Workers don’t have access to these functions.
To resolve this issue:
This error is not coming from your pixel code, so you don’t need to fix anything in your extension.
It’s likely that another app installed on your development store has a pixel that’s unaware of the context it is running in (trying to use alert() in a context where it doesn’t exist).
The error won’t affect your pixel’s functionality, though it might be noisy in your console.
If you’re developing locally and want to reduce console noise, you could temporarily disable other pixels in your development store during testing. If this is occurring in production, you might want to inform the other app’s developer that their pixel is causing console errors by trying to access window functions in a Web Worker context.
Looking carefully at your logs, there are two different sources generating console output:
Your pixel extension - which is logging the page_viewed event
Another pixel (web-pixel-1027375272@…) - which is generating the browser/settings/analytics logs and the alert error
This would confirm that you have at least two different app pixels running on your store:
Your extension (working correctly)
Another app’s pixel (triggering the alert error)
When you uninstalled your app, you were still seeing errors because the problematic pixel belongs to a different app that remained installed.
This error appears to be completely unrelated to your code and could be safely ignored as it won’t affect your extension.
If you want to eliminate the error, you would need to identify which other app is adding this pixel (ID: 1027375272) and either contact its developer or consider uninstalling it if it’s not needed.
@adarsh_anncode I’d like to help investigate this issue properly. Could you share your development store URL with me if you’re comfortable doing so? This would help me understand what’s happening with the removed extension still generating errors.
If you prefer not to share your dev store URL (which is completely understandable for privacy/security reasons), it would be best to continue this conversation through official support channels.
This leads me to think that the code you shared in your initial post is not the actual code the pixel is trying to execute. I could not find any pixel code related to the page_viewed log in your example. Has the app been updated with this new code?
To continue our investigation, could you do the following:
Start your local environment dev server with your custom app
In your browser’s developer tools, look for your custom app in the “Sources” panel (like shown in the above screenshot)
@bdestrempes Thank you so much for your help. Your explanation about the alert issue in the Web Worker context really clarified things for me. I appreciate the support!
I have two store, where the same app installed in them as well running.
But in one store setting>customer event button is disabled, and in 2nd store have app showing disconnected.