Most env-var validation checks that values exist. That catches missing config but misses the worse case - a value that is present, valid in shape, and silently wrong. Here is the asymmetric pattern for separating loud failures from silent ones in a Next.js server.
Duncan Leung
📚 Learning, 👨🏻💻 Building, 📝 Documenting...
Hi! I'm Duncan Leung and I currently lead Frontend Engineering at Airvet.
In a previous career I worked overseas in Beijing as a Product Manager at a skunkworks studio building digital experience projects for Ford Motor (China) and consulted on UX projects for Starwood Hotels. During this time I also mentored startups at Chinaccelerator and ran startup events and hackathons in Shanghai.
👨🏻💻 I'm a self taught software developer, and this is a place for me to jot down some notes. I mostly cover Javascript, Typescript, React, and software development.
Latest Writing
- Read article
- Read article
Most SQS idempotency guides reach for Redis dedupe keys or dedupe tables. If your worker's job ends in a terminal state-machine transition, the row's own status column is already the lock - and one UPDATE statement is the entire safety story.
- Read article
Learn how to configure MCP (Model Context Protocol) servers globally for Claude Code, making them available across all your projects.
- Read article
A guide to the upcoming changes in ESLint v9 regarding TypeScript integration, including migration notes.
- Read article
How to solve one of the most frustrating UX issues in chat applications: ensuring automatic scrolling works correctly when images load asynchronously.
Newsletter
Stay updated, receive the latest post straight to your mailbox