惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
V
V2EX
PCI Perspectives
PCI Perspectives
Latest news
Latest news
博客园 - 三生石上(FineUI控件)
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Palo Alto Networks Blog
T
The Exploit Database - CXSecurity.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
WordPress大学
WordPress大学
V
Vulnerabilities – Threatpost
H
Heimdal Security Blog
Attack and Defense Labs
Attack and Defense Labs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - 叶小钗
V
Visual Studio Blog
Jina AI
Jina AI
P
Proofpoint News Feed
罗磊的独立博客
SecWiki News
SecWiki News
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 热门话题
Security Archives - TechRepublic
Security Archives - TechRepublic
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
N
News and Events Feed by Topic
NISL@THU
NISL@THU
T
Tailwind CSS Blog
T
Tenable Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Recent Announcements
Recent Announcements
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Tor Project blog
宝玉的分享
宝玉的分享
Help Net Security
Help Net Security
S
Security Affairs
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
G
GRAHAM CLULEY

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
The node_modules That Wouldn't Die
Vineeth N Kr · 2026-04-29 · via DEV Community

The node_modules That Wouldn't Die

A ghostly translucent folder labelled node_modules hovering above a dusty old server rack, cobwebs in the corners, faint blue glow lighting the room.

TL;DR - An internal app of mine refused to deploy because the build kept importing the wrong version of a Vite plugin. The lockfile said one thing, the build was doing another. I blamed the codegen. Then I blamed git. Both times I was wrong. The actual culprit was a node_modules directory sitting on the deploy host from a previous era of the project, surviving every git reset --hard because it was never tracked in the first place. Once I cleared that out, the build broke a second time for almost the same reason. Here is the story.

The error that started it

Deploy of an internal app of mine fails at the build step with this beauty:

SyntaxError: The requested module './chunk-XYZ.js' does not provide an export named 'tanstackRouter'

Enter fullscreen mode Exit fullscreen mode

I knew this one. @tanstack/router-plugin renamed its main export from TanStackRouterVite to tanstackRouter at some point. The lockfile on main was pinned to a version where the new name was correct. The Vite config was importing the new name. Everything on my machine was happy.

So why was the live host trying to call the new name on an older module that did not export it?

Suspect one, the codegen

The app uses Orval to generate its API client off a Swagger spec. My first thought was that one of those generated files was importing the plugin somehow, and that the codegen had drifted on the host. I went hunting through the generated output. Nothing there even touched Vite plugins.

Dead end. Time wasted. Moving on.

Suspect two, git not really resetting

The deploy script does git fetch && git reset --hard origin/main before building. So I started suspecting the reset was not really happening. Maybe the script was running in the wrong directory. Maybe the working tree was somehow detached and the reset was a no-op. I sshed in, ran the commands by hand, watched them tell me everything was clean.

Tell me I am not the only one who has stared at a "nothing to commit, working tree clean" and refused to believe it.

The tree was clean. The lockfile was right. So what was I building from?

The actual culprit

Here is the line in the Dockerfile that I had not been thinking hard enough about:

COPY . .

Enter fullscreen mode Exit fullscreen mode

That copies everything in the build context into the image. Including node_modules if one happens to be sitting in the build context.

And here is what I had completely forgotten about git reset --hard. It does not delete untracked files. Neither does git checkout -f. Both will happily clobber tracked files back to their committed state. But anything that was never committed in the first place is invisible to them. It just sits there. Forever. Quietly.

Sitting on the deploy host, undisturbed across who knows how many deploys, was a node_modules directory from a much older incarnation of the project. The pnpm install step inside the Dockerfile was running, sure. But COPY . . ran first and dropped a years-old node_modules into the image, and whatever pnpm did on top of that was not enough to overwrite the bits that mattered. The version of @tanstack/router-plugin that ended up in the final image was the one that had been sitting on the host since the previous era, where the export was still called TanStackRouterVite.

A folder older than the bug. Quietly winning every deploy.

The cleanup that broke things again

Easy fix, right? rm -rf node_modules on the host, redeploy, done.

The build broke again. A missing API client file this time. And then I noticed it. The same gitignored exception was hiding two more freeloaders. The Orval output directory and a generated swagger.json, both gitignored, both supposed to be regenerated by the build, were also surviving across deploys. They had been sitting on the host so long that nobody had noticed the build itself never actually ran the generators properly. The host filesystem was the only reason the app had a working API client at all.

So I cleaned those out too, and then fixed the actual generation step in the Dockerfile. Because if a fresh checkout of the repo into a clean container could not produce a working build, that was the real problem all along.

What I changed

Three small things, none of them clever.

A proper .dockerignore in the repo. node_modules, dist, and the generated client directories all listed. The build context never sees the host's leftovers again.

The Dockerfile now runs the generators itself. The API client is produced inside the build, off a swagger.json that is also generated inside the build. No host artifact is load-bearing.

One full cleanup of the deploy host, by hand, of every gitignored thing. Then a redeploy from scratch. It worked on the first try, which felt suspicious until I remembered that is what builds are supposed to do.

The lesson

A long-lived deploy host is a museum. Every gitignored thing you have ever built on it is still there unless you actively remove it. git pull, git reset, git clean without the right flags, none of them touch the museum. Your Dockerfile does not know it is being lied to. Your lockfile does not know it is being overruled. The build just shrugs and ships you whatever the host happens to be wearing that day.

Two rules from now on.

Anything gitignored is regenerated, never inherited. If your build relies on a file the repo does not track, that file must be produced inside the build. Period. If you are shrugging at this rule because "it has been working fine", that is exactly what I was doing.

.dockerignore is not optional. Without it, your build context is a snapshot of whatever weird state the host has accumulated, and COPY . . is a great way to ship that weirdness into your image.

The whole fiasco was three cleanups, an embarrassing number of wrong guesses, and a lesson I should have learned the first time I saw git reset --hard and assumed it meant what it sounds like. It does not. Untracked is invisible.

Not going to pretend this was a perfect writeup. But if even one part of it helped someone avoid the headache I went through, then it was worth putting down. See you in the next one.