Troubleshooting
Known gotchas you may hit while developing on Groundwork, with root causes and, where possible, fixes already applied. They include hydration warnings that come from a browser extension injecting content into <head> (no bug in the app), a dist/index.js build crash caused by Shopify CLI's bundle-analyzer plugin not fully supporting Rolldown, and a long list of npm audit findings that mostly collapse into two harmless, dev-only root causes.
It's for a developer who's hit one of these symptoms and wants the real cause before spending an afternoon debugging root.tsx or entry.client.tsx for a problem that isn't there. Afterwards you'll know how to confirm a hydration warning is extension interference (the Incognito-window check), why --no-bundle-stats is already set in the build script, and why running npm audit fix --force here would quietly reintroduce a build-breaking downgrade.
Related: Architecture, which points here for anyone hitting a build error or console warning that doesn't trace back to their own changes.
Source: docs/TROUBLESHOOTING.md
Known gotchas you may hit while developing on this template, and what to do about them.
Hydration warnings from browser extensions
Symptom: the browser console shows Warning: Expected server HTML to contain a matching <head> in <html>, followed by Uncaught Error: Hydration failed because the initial UI does not match what was rendered on the server, and the page falls back to full client-side rendering. It may also present as parts of the page (like the cart) failing to load correctly on first paint.
Cause: this is almost never a bug in the app itself. React's hydration check compares the server-rendered HTML against what the client would produce on its first render, node for node. root.tsx's <head> is fully static (nothing in it depends on the route, loader data, or theme cookie), so there's no code path in this template that can make the server and client disagree about what belongs there.
What can make them disagree is a browser extension injecting its own <meta>, <style>, or <link> tags into the page before React hydrates. React sees a node in <head> it didn't render and (correctly) flags the mismatch. It's a well-known false alarm across the whole React/Remix/React Router ecosystem, and Hydrogen isn't special here.
How to confirm it's an extension and not a real bug:
- Open the same page in an Incognito/Private window (most extensions are disabled there by default) and check the console. If it's clean, you've confirmed it's extension interference.
- To find the specific offender, go to
chrome://extensions/(or your browser's equivalent), disable extensions in batches, and reload between each until the warning disappears. Narrow down from there one at a time.
Known offenders: Dark Reader and other page-theming/color-injector extensions are frequent causes, since they actively rewrite styles on page load. Dark Reader in particular can still interfere when it's toggled "off" for a site, because the extension can stay active in the background. Ad blockers, password managers, and shopping/coupon extensions are the other usual suspects, since they commonly inject content into <head> early.
If you're building on this template and see this locally: don't start by chasing it in the app code. Rule out your own browser extensions with the Incognito check above before assuming it's something in root.tsx, entry.client.tsx, or a route's meta()/links() export.
Bundle report: where it went
Under Hydrogen 2026.4 the build ran through shopify hydrogen build, whose built-in --bundle-stats analyzer crashed under Rolldown (Vite's bundler) with ENOENT ... dist/index.js; the template passed --no-bundle-stats and used rollup-plugin-bundle-stats instead. Hydrogen 2026-10 builds with plain react-router build, which has no analyzer of its own, so the flag is gone and rollup-plugin-bundle-stats in vite.config.ts is now simply the bundle report. It covers both the client and server bundles.
/api/cart returns 404, or the cart never updates
Cause: Hydrogen's request handlers run in the root route's middleware export, which React Router 7 only executes with future.v8_middleware: true in react-router.config.ts. Without it nothing fails to build; /api/cart, /checkout and the Storefront API proxy just fall through to the app's 404.
Check: with npm run dev running, GET /api/cart must return JSON ({"cart":null} with no cart cookie). If it returns the 404 page, the flag is off.
Add to cart does nothing in the browser
Cause: the cart store sends changes through Shopify's Standard Actions runtime, which <ShopifyScripts> loads from cdn.shopify.com. If that script is blocked (a strict CSP, an ad blocker, an offline sandbox), cart actions reject with "Standard Actions not available". The forms still post to /api/cart without JavaScript, so a full-page submit works, but the optimistic update and the cart drawer don't.
npm install reports a large number of vulnerabilities
Symptom: npm install finishes with a summary like 22 vulnerabilities (2 low, 3 moderate, 17 high). Running npm audit for details shows a long list of packages, most tagged high.
Don't panic, and don't run npm audit fix --force. Two things make this look scarier than it is:
- The vast majority collapse into two root causes. Every
@graphql-codegen/*/@shopify/*-codegenentry traces back to one old transitivelodashcopy (a code-injection and prototype-pollution CVE). Everybody-parser/qs/cookie/youch/undici/wsentry traces back tominiflare, the Cloudflare Workers emulator bundled inside@shopify/mini-oxygen. Runnpm ls <package-name>on any flagged package to see this for yourself. It collapses a "17 high" number down to two actual issues. - None of it is production-facing. The codegen packages only run during
npm run codegen/dev/buildto generate TypeScript types. They never ship to the browser or the deployed Oxygen worker. The miniflare packages only run inside your local dev server (npm run dev/preview), and Shopify's real Oxygen production runtime doesn't use them at all. The worst case is a DoS or memory-exhaustion issue against your own machine whilenpm run devis running. Customers' storefronts aren't exposed.
Why not npm audit fix --force: its suggested "fixes" for @shopify/mini-oxygen and @shopify/hydrogen-codegen are actually downgrades below versions this template needs for other reasons (see the CLI section above). npm's automated resolver doesn't reason correctly about this project's peer constraints. Running it would silently reintroduce the build crash.
Fix already applied in this template: package.json's overrides field forces patched versions of the packages where it's safe to do so: lodash, ws, body-parser, qs, and undici (scoped specifically to @shopify/mini-oxygen's own direct dependency; miniflare's separately-pinned older copy is left alone). This brings the count down to a handful of low-severity findings still nested inside miniflare's own dependency tree (typically cookie/youch), which are left alone deliberately: forcing them further would mean overriding Shopify's own bundled, tested dev-server dependency versions for a low-severity, local-only issue.
If new vulnerabilities show up after a dependency bump: run npm audit and npm ls <package> on each flagged package before reaching for npm audit fix. Trace it back to its real root and check whether it's a devDependency-only (codegen/dev-server) issue before treating it as urgent.