Urgent.News

What's breaking now, across thousands of outlets.

Tech

Four Failures I Kept Repeating on AWS Amplify — Full env Replacement, Green Build but 500 at Runtime, Silent Outages, Domain Migration

From April to July 2026, I ran several Next.js products on AWS Amplify Hosting (AWS's managed service for hosting and deploying web apps). This article sorts the "Amplify-specific failures" I kept repeating into four categories: env vars disappearing, builds passing but the app failing at runtime, failures progressing silently, and domain migrations tripping over stale CloudFront (AWS's CDN)…

In April to July 2026, the author experienced several recurring issues while running Next.js products on AWS Amplify Hosting. These four categories of failures were sorted into a detailed article, which is broken down below with the key facts presented in a new order for better readability.

Failure 1: update-app replaces all of your env

When attempting to add a single environment variable, the author inadvertently replaced the entire environment-variable map using the update-app command. This replacement feature does not append new variables but instead replaces the entire map, wiping out existing values such as ONION_CLIENT_ID. The affected production authentication was not restored until the environment was rebuilt after editing, which is a critical oversight.

The author now advises confirming whether an env-manipulation API appends or replaces and to rebuild the application after editing env. Build passing does not guarantee runtime functionality, especially in SSR environments where branch environment variables are not passed to the runtime Lambda.

Failure 2: The build passes, but it fails at runtime

This category highlights a more insidious issue. Amplify SSR does not forward branch environment variables to the runtime Lambda, and NEXT_PUBLIC_* variables are baked into the build time. A passing build does not guarantee that the app will run correctly at runtime, as it can return 500 errors for missing env variables. To address this, the author recommends baking env into the .env.production file during the preBuild phase or using a runtime resolution layer for env variables.

This ensures that failures are not hidden until runtime. Additionally, the author emphasizes the importance of not hiding failures and utilizing build-once + runtime injection for a reliable environment management system.

Failure 3: Failures progress silently

This category deals with outages that remain undetected due to inadequate monitoring or testing. One notable instance involved the admin console going blank, but the issue went unnoticed because access was blocked silently, resulting in HTTP 200 responses with sample data instead of error messages. To prevent such silent failures, the author suggests fail-loud practices, ensuring that errors are not hidden behind a 200 response.

They also recommend staging promotion, which involves promoting changes to a staging environment before deploying to production, and implementing authenticated end-to-end (E2E) testing to catch failures early in the development cycle.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Lists in Python for Beginners

A List can be considered as a dynamic array. It is denoted by [ ]. The values inside a list are called elements . The values in a list can be homogeneous (i.e., all elements are of the same data type)…

  • Python lists store collections of elements, allowing homogeneous or heterogeneous data.
  • Lists automatically adjust size as elements are added or removed, expanding in increments of four.

The LCU Trap: Why Your Load Balancer Bill Has Nothing To Do With Bandwidth

` Most engineers assume load balancer costs scale with throughput: "We push 2 Gbps, so our bill should reflect 2 Gbps." That intuition is wrong. AWS doesn't bill ALB or NLB by throughput.

  • Load balancer costs based on Load Balancer Capacity Units (LCU), not bandwidth.
  • Optimizing non-LCU factors has no impact on load balancer bill.

More from Thursday 27 August →