# \[URGENT\] Injected WebMCP loader leaks globals (d/n/s), breaks storefront scripts

**URL:** <https://community.shopify.dev/t/urgent-injected-webmcp-loader-leaks-globals-d-n-s-breaks-storefront-scripts/36118>\
**Category:** Online Store and Theme Development\
**Tags:** theme-troubleshootin\
**Created:** [July 17, 2026, 7:58am UTC](https://community.shopify.dev/t/urgent-injected-webmcp-loader-leaks-globals-d-n-s-breaks-storefront-scripts/36118 "2026-07-17T07:58:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![opal](https://avatars.discourse-cdn.com/v4/letter/o/b3f665/32.png) [@opal](https://community.shopify.dev/u/opal)\
**Post date:** [July 17, 2026, 7:58am UTC](https://community.shopify.dev/t/urgent-injected-webmcp-loader-leaks-globals-d-n-s-breaks-storefront-scripts/36118/1 "2026-07-17T07:58:47Z")

</div>

### 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

1. 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", ""))`
2. 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)`
3. Load the page and open DevTools console.
4. 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

---

<div class="post-metadata">

**Author:** ![Alan\_G](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/alan_g/32/5321_2.png) [@Alan\_G](https://community.shopify.dev/u/Alan_G)\
**Post date:** [July 17, 2026, 6:21pm UTC](https://community.shopify.dev/t/urgent-injected-webmcp-loader-leaks-globals-d-n-s-breaks-storefront-scripts/36118/2 "2026-07-17T18:21:28Z")

</div>

Hey @opal - thanks for flagging. We’re looking into this, can’t guarantee an exact time, but a fix should be rolled out very shortly.
