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