Desk Clarity

A field guide to everyday digital problems.

The guidebook / 181 guides

Developer tools

Code, configuration and workflows. Source-linked checks to help you move forward.

Developer tools · GUIDE

Docker COPY Cannot Find a Host File: Check the Build Context Boundary

COPY reads from the selected build context, not from an arbitrary host path.

2 min readSource-linked guide
Developer tools · GUIDE

Compose Restart Keeps Old Environment Values: Review and Recreate the Service

Restarting an existing container does not apply a changed Compose environment configuration.

2 min readSource-linked guide
Developer tools · GUIDE

Fetch Resolves a 404 Response: Check HTTP Status Before Parsing Success Data

A received HTTP error response can fulfill the fetch promise.

2 min readSource-linked guide
Developer tools · GUIDE

JavaScript Defaults Replace Zero or False: Use Nullish Coalescing for Missing Values

Use ?? when only null and undefined should trigger a default.

2 min readSource-linked guide
Developer tools · GUIDE

Awaiting an Array Map Does Not Await Its Tasks: Aggregate the Returned Promises

An async map callback returns a promise for each element.

2 min readSource-linked guide
Developer tools · GUIDE

Array Map with parseInt Produces NaN: Stop Passing the Index as the Radix

Map calls its callback with more than the element.

2 min readSource-linked guide
Developer tools · GUIDE

JavaScript Sort Puts 10 Before 2: Use a Numeric Comparator and Choose Mutation

Array sort without a comparator uses string ordering.

2 min readSource-linked guide
Developer tools · GUIDE

JavaScript Date-Only Text Shows the Previous Day: Decide Between a Calendar Date and an Instant

The standard YYYY-MM-DD form is parsed as UTC midnight.

2 min readSource-linked guide
Developer tools · GUIDE

Printf Misreads Percent Signs in a Variable: Keep the Format Literal

Pass data as a separate argument to printf.

2 min readSource-linked guide
Developer tools · GUIDE

Bad Interpreter with ^M: Inspect the Script Line Endings Before Changing Permissions

If an interpreter path ends with ^M, inspect the first line for carriage-return bytes.

2 min readSource-linked guide
Developer tools · GUIDE

Bash Prefix Assignment Changes the Child Environment, Not Earlier Argument Expansion

In a command such as LABEL=new printf ...

2 min readSource-linked guide
Developer tools · GUIDE

A Bash Heredoc Expands Template Variables Too Early: Quote the Delimiter

Quote the heredoc delimiter when writing literal shell or template text.

2 min readSource-linked guide
Developer tools · GUIDE

Bash Read Changes Backslashes or Spaces: Choose Raw Line Input Explicitly

For a literal text line, use IFS= read -r value.

2 min readSource-linked guide
Developer tools · GUIDE

Bash Command Substitution Removes Final Newlines: Preserve Bytes in a File

Quoting a command substitution preserves embedded newlines from word splitting, but it does not restore final newlines removed by the substitution itself.

2 min readSource-linked guide
Developer tools · GUIDE

Docker Logs Is Empty: Check Where the Application Writes and Which Driver Collects It

An empty docker logs result does not prove that the application produced no diagnostics.

2 min readSource-linked guide
Developer tools · GUIDE

Data Missing After Compose Down: Check Volume Identity Before Restoring

Compose down normally removes service containers and networks, not named volumes.

2 min readSource-linked guide
Developer tools · GUIDE

Compose Depends On Starts First but the Database Is Not Ready

Ordinary dependency startup order does not prove application readiness.

2 min readSource-linked guide
Developer tools · GUIDE

Files Disappear Under a Docker Bind Mount: Compare Image Content and Host Source

A bind mount over an image directory hides the image files at that path for that container.

2 min readSource-linked guide