[{"data":1,"prerenderedAt":408},["ShallowReactive",2],{"navigation":3,"/blog/postmortem-cloudflare-worker-dependency-deploy":154,"surround-postmortem-cloudflare-worker-dependency-deploy":396},[4],{"title":5,"path":6,"stem":7,"children":8,"page":153},"Blog","/blog","blog",[9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149],{"title":10,"path":11,"stem":12},"How to Increase Free Tier Memory on AWS EC2","/blog/aws-ec2-ram","blog/aws-ec2-ram",{"title":14,"path":15,"stem":16},"Blooper: The Disappearing Cloudflare Variables","/blog/blooper-cloudflare-env-vars","blog/blooper-cloudflare-env-vars",{"title":18,"path":19,"stem":20},"Blooper: Hardcoded Content Links cause 404s","/blog/blooper-hardcoded-nuxt-content-links","blog/blooper-hardcoded-nuxt-content-links",{"title":22,"path":23,"stem":24},"Blooper: The Invisible SEO","/blog/blooper-nuxt-seo-env","blog/blooper-nuxt-seo-env",{"title":26,"path":27,"stem":28},"Blooper: The SSR Crash of Doom","/blog/blooper-ssr-feedback-form","blog/blooper-ssr-feedback-form",{"title":30,"path":31,"stem":32},"Blooper: The YouTube Crawl Budget Killer","/blog/blooper-video-crawl-budget","blog/blooper-video-crawl-budget",{"title":34,"path":35,"stem":36},"Blooper: PWA Redirecting SPA Routes","/blog/blooper-vite-pwa-ssr-redirects","blog/blooper-vite-pwa-ssr-redirects",{"title":38,"path":39,"stem":40},"Git Branching in 2026: Code State, Environment Isolation, and Modern CD","/blog/branch-theater-staging-branches","blog/branch-theater-staging-branches",{"title":42,"path":43,"stem":44},"The Developer's Guide to Avoiding Cloud Billing Traps in 2026","/blog/cloud-billing-traps-2026","blog/cloud-billing-traps-2026",{"title":46,"path":47,"stem":48},"Disk Management in Linux","/blog/disk-management-in-linux","blog/disk-management-in-linux",{"title":50,"path":51,"stem":52},"Docker Devtools Stage | Powerlevel, OhMyZSH, tmux, fuzzy finder, autocomplete etc","/blog/docker-devtools","blog/docker-devtools",{"title":54,"path":55,"stem":56},"Docker container | Resolving Permission Denied Woes: A Decade-Long Struggle Unraveled","/blog/docker-non-root-user-perms","blog/docker-non-root-user-perms",{"title":58,"path":59,"stem":60},"The Ultimate Guide to Free Tier Hosting Platforms (Serverless & Containers)","/blog/free-hosting-platforms-guide","blog/free-hosting-platforms-guide",{"title":62,"path":63,"stem":64},"Git commands | underrated","/blog/git-commands-underrated","blog/git-commands-underrated",{"title":66,"path":67,"stem":68},"Journey: Taming Edge Caching and KV Storage","/blog/journey-github-streak-caching","blog/journey-github-streak-caching",{"title":70,"path":71,"stem":72},"Kubernetes Cluster Setup Guide","/blog/k8s-setup","blog/k8s-setup",{"title":74,"path":75,"stem":76},"Linux WiFi Drivers","/blog/linux-wifi-drivers","blog/linux-wifi-drivers",{"title":78,"path":79,"stem":80},"4 Common Routing Traps When Migrating to Nuxt i18n","/blog/nuxt-i18n-routing","blog/nuxt-i18n-routing",{"title":82,"path":83,"stem":84},"Patch the CVE, Don't Trigger an Accidental Refactor: Surviving PHP2Shell on Docker","/blog/patching-php2shell-docker-playbook","blog/patching-php2shell-docker-playbook",{"title":86,"path":87,"stem":88},"pfSense basic firewall setup","/blog/pfsense-basic-firewall-setup","blog/pfsense-basic-firewall-setup",{"title":90,"path":91,"stem":92},"pfSense Quickstart","/blog/pfsense-quickstart","blog/pfsense-quickstart",{"title":94,"path":95,"stem":96},"Postmortem: Cloudflare Worker Missing Dependency on Deploy","/blog/postmortem-cloudflare-worker-dependency-deploy","blog/postmortem-cloudflare-worker-dependency-deploy",{"title":98,"path":99,"stem":100},"Postmortem: Serverless HTTP Driver Transaction Failures","/blog/postmortem-neon-http-transactions","blog/postmortem-neon-http-transactions",{"title":102,"path":103,"stem":104},"Postmortem: The Ghost in the Chrome Cache (Nuxt & Cloudflare Pages)","/blog/postmortem-nuxt-cloudflare-chunk-error","blog/postmortem-nuxt-cloudflare-chunk-error",{"title":106,"path":107,"stem":108},"Postmortem: Nuxt Content 404s on Staging Deployments","/blog/postmortem-nuxt-content-404-staging","blog/postmortem-nuxt-content-404-staging",{"title":110,"path":111,"stem":112},"Postmortem: 500 Internal Server Error on ISR Routes","/blog/postmortem-nuxt-content-payload-extraction","blog/postmortem-nuxt-content-payload-extraction",{"title":114,"path":115,"stem":116},"Post-Mortem: Intrusive Database Driver Refactoring","/blog/postmortem-proxy-re-architecting","blog/postmortem-proxy-re-architecting",{"title":118,"path":119,"stem":120},"Post-Mortem: Cloudflare Worker Connection Hang & Resilient DB Fallbacks","/blog/postmortem-worker-db-connection-hang","blog/postmortem-worker-db-connection-hang",{"title":122,"path":123,"stem":124},"Pro Tip: Sandboxing Cloudflare Workers for AI Agents","/blog/pro-tip-wrangler-local-dev-trick","blog/pro-tip-wrangler-local-dev-trick",{"title":126,"path":127,"stem":128},"Proxmox DNS Management","/blog/proxmox-dns","blog/proxmox-dns",{"title":130,"path":131,"stem":132},"Proxmox Recovery","/blog/proxmox-recovery","blog/proxmox-recovery",{"title":134,"path":135,"stem":136},"Proxmox WiFi Connection Story","/blog/proxmox-wifi","blog/proxmox-wifi",{"title":138,"path":139,"stem":140},"roadauth-rails api jwt cors","/blog/rodauth-jwt","blog/rodauth-jwt",{"title":142,"path":143,"stem":144},"SOCKS5 Proxy Quickstart","/blog/sock5-proxy","blog/sock5-proxy",{"title":146,"path":147,"stem":148},"tmux status bar toggle","/blog/tmux-status","blog/tmux-status",{"title":150,"path":151,"stem":152},"UFW - Cheatsheet","/blog/ufw-cheatsheet","blog/ufw-cheatsheet",false,{"id":155,"title":94,"authors":156,"badge":162,"body":164,"date":385,"description":386,"extension":387,"image":388,"imageComponent":389,"meta":390,"navigation":391,"path":95,"pinned":153,"seo":392,"seoImage":393,"stem":96,"__hash__":395},"posts/blog/postmortem-cloudflare-worker-dependency-deploy.md",[157],{"name":158,"to":159,"avatar":160},"Rahul Dhole","/",{"src":161},"/profile.png",{"label":163},"Postmortem",{"type":165,"value":166,"toc":380},"minimark",[167,172,194,198,266,270,376],[168,169,171],"h2",{"id":170},"_1-the-issue","1. The Issue",[173,174,175,188],"ul",{},[176,177,178,182,183,187],"li",{},[179,180,181],"strong",{},"Symptom:"," The Cloudflare CI/CD pipeline failed to build a worker service with a missing dependency error: ",[184,185,186],"code",{},"✘ [ERROR] Could not resolve \"@cloudflare/containers\"",".",[176,189,190,193],{},[179,191,192],{},"Impact:"," We were unable to deploy updates to the staging or production environments for the worker.",[168,195,197],{"id":196},"_2-root-cause","2. Root Cause",[173,199,200,210,219,233,241,255],{},[176,201,202,205,206,209],{},[179,203,204],{},"Monorepo / Package Manager Quirks:"," The issue stemmed from an unintended interaction between Cloudflare's auto-detected build steps and ",[184,207,208],{},"pnpm"," workspaces.",[176,211,212,213,215,216,187],{},"Cloudflare's build system auto-detected ",[184,214,208],{}," from our lockfiles and automatically ran ",[184,217,218],{},"pnpm install --frozen-lockfile",[176,220,221,222,225,226,228,229,232],{},"Because the worker directory (",[184,223,224],{},"apps/core/workers/service/",") is inside our project but isn't explicitly configured as a workspace member, ",[184,227,208],{}," traversed upwards until it found the ",[184,230,231],{},"pnpm-workspace.yaml"," in the core directory.",[176,234,235,237,238,187],{},[184,236,208],{}," then executed the install for the core application, placing dependencies in ",[184,239,240],{},"apps/core/node_modules/",[176,242,243,244,247,248,251,252,187],{},"Since ",[184,245,246],{},"@cloudflare/containers"," was only listed in the worker's local ",[184,249,250],{},"package.json",", it was entirely skipped by this workspace-level ",[184,253,254],{},"pnpm install",[176,256,257,258,261,262,265],{},"When ",[184,259,260],{},"npx wrangler deploy"," subsequently ran, Wrangler's ",[184,263,264],{},"esbuild"," bundler couldn't find the dependency anywhere in the tree.",[168,267,269],{"id":268},"_3-the-resolution","3. The Resolution",[173,271,272,349],{},[176,273,274,277,278,280,281,284,285,287,288],{},[179,275,276],{},"Using npm for Isolation:"," The fix was to switch the deploy script in the worker's ",[184,279,250],{}," to explicitly use ",[184,282,283],{},"npm"," instead of relying on the environment's default ",[184,286,208],{}," command:\n",[289,290,295],"pre",{"className":291,"code":292,"language":293,"meta":294,"style":294},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\"scripts\": {\n  \"deploy:staging\": \"npm install && npx wrangler deploy --env staging\"\n}\n","json","",[184,296,297,319,343],{"__ignoreMap":294},[298,299,302,306,310,312,316],"span",{"class":300,"line":301},"line",1,[298,303,305],{"class":304},"sMK4o","\"",[298,307,309],{"class":308},"sfazB","scripts",[298,311,305],{"class":304},[298,313,315],{"class":314},"sTEyZ",": ",[298,317,318],{"class":304},"{\n",[298,320,322,325,329,331,334,337,340],{"class":300,"line":321},2,[298,323,324],{"class":304},"  \"",[298,326,328],{"class":327},"spNyl","deploy:staging",[298,330,305],{"class":304},[298,332,333],{"class":304},":",[298,335,336],{"class":304}," \"",[298,338,339],{"class":308},"npm install && npx wrangler deploy --env staging",[298,341,342],{"class":304},"\"\n",[298,344,346],{"class":300,"line":345},3,[298,347,348],{"class":304},"}\n",[176,350,351,354,355,357,358,360,361,364,365,368,369,371,372,375],{},[179,352,353],{},"Why this works:"," ",[184,356,283],{}," ignores ",[184,359,231],{}," and ",[184,362,363],{},"pnpm-lock.yaml",". When ",[184,366,367],{},"npm install"," is explicitly invoked within the worker directory, it successfully parses the local ",[184,370,250],{},", creating a local ",[184,373,374],{},"node_modules"," folder with the necessary dependencies. Wrangler then successfully resolves and bundles the code.",[377,378,379],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":294,"searchDepth":321,"depth":321,"links":381},[382,383,384],{"id":170,"depth":321,"text":171},{"id":196,"depth":321,"text":197},{"id":268,"depth":321,"text":269},"2026-06-08","How to fix missing dependencies when deploying Cloudflare Workers from within a monorepo workspace.","md",null,{"type":163},{},true,{"title":94,"description":386},{"src":394},"https://placehold.co/800x400/0f172a/3b82f6?text=Cloudflare+Worker+Dependencies","5pUwZNGthYqFNu4L0wNqT5U0PSnQs-7uE1qM2A_2HAA",[397,403],{"title":90,"path":91,"stem":92,"description":398,"imageComponent":399,"seoImage":401,"children":-1},"pfSense Quickstart - Dive into the details of pfsense quickstart with this quick guide.",{"type":400},"Networking",{"src":402},"https://placehold.co/800x400/0f172a/3b82f6?text=pfSense+Quickstart",{"title":98,"path":99,"stem":100,"description":404,"imageComponent":405,"seoImage":406,"children":-1},"Why database transactions fail in serverless HTTP drivers and how to architect around them using compensating transactions.",{"type":163},{"src":407},"https://placehold.co/800x400/0f172a/3b82f6?text=Serverless+HTTP+Transactions",1792753000539]