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