Short description of issue
Shopify recently began injecting an inline WebMCP adapter loader script into storefronts. It is a classic (non-module) script that declares `var d, var n` and `function s` at top level, leaking all three into the global scope. Any theme or third-party script that declares the same identifiers with let/const at top level (extremely common in minified code e.g. instant.page) now throws “Uncaught SyntaxError: Identifier ‘n’ has already been declared”, which kills that entire script. This broke previously-working functionality on our store with no changelog notice and no opt-out.
Reproduction steps
- Open any Shopify storefront — the WebMCP adapter loader is currently injected into every store (inline script declaring var d, var n, function s, then calling
s("https://cdn.shopify.com/storefront/webmcp/webmcp-0.0.4.js", "")) - Include any classic that declares a top-level const/let named d, n, or s. Example: the minified instant.page script inlined without
type="module" (declares const n = new Set(), s = ..., d = 1111) - Load the page and open DevTools console.
- Observe:
Uncaught SyntaxError: Identifier 'n' has already been declared. The colliding script never executes — in our case, link prefetching silently stopped working store-wide.
Minimal repro on any Shopify store, no library needed:
<script>const n = 1;</script> → SyntaxError, script dead.
Because the loader is injected platform-wide, every store running a theme or app script with these identifier names is currently affected.
Additional info
Since this is injected into every storefront on the platform, the blast radius is the entire merchant base: any theme, app, or custom script using top-level d, n, or s (trivially common in minified output) is currently broken, and merchants have no way to diagnose it beyond a cryptic SyntaxError.
What type of topic is this
Bug report