Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,965 guides across 14 topics

Topics

Latest guides

3D illustration of a schema cube with a runtime shield overlapping a hollow type-only wireframe cube, error issue tags floating off
TypeScript

Zod infer vs TypeScript Interfaces: Runtime Validation Gaps

An interface validates nothing, z.infer is the output type and not the input, and Zod 4 renamed the error helpers. What each one actually guarantees.

TypeScriptZodValidationAPI
3D illustration of two decorator plate stacks feeding a class cube, one with a metadata tag and one without, an error badge between
TypeScript

TypeScript Decorators: Standard vs experimentalDecorators

TS1240 appears when a legacy decorator meets the stage 3 transform, and the reverse breaks NestJS DI. How the two signatures differ and which flag each stack needs.

TypeScriptDecoratorsNestJSAngular
3D illustration of a React atom cube with a ref plug becoming a plain socket and a cleanup thread unspooling from it
React

React 19 Ref Cleanup Functions and forwardRef Deprecation

ref is a normal prop now and a ref callback may return a cleanup function, which breaks every implicit-return callback. Migration steps and the leak it fixes.

ReactRefsMigrationTypeScript
3D illustration of a form panel with a redirect arrow looping back into itself and a size gauge tipping past a limit marker
Next.js

Next.js Server Actions: Swallowed Redirects and Body Limits

redirect() throws, so a try/catch swallows the navigation; the action body parser has a 1 MB limit; and useActionState cannot hold an Error. Fixes for all three.

Next.jsServer ActionsFormsDebugging
3D illustration of a cookie jar and an auth token slab being split between a server cube and a browser cube, a locked padlock between them
Next.js

Supabase SSR on Next.js: Stale Sessions and Lock Timeouts

The session flips between signed-in and signed-out because the refreshed token is written to a cookie store that no longer exists. Adapter, proxy and lock fixes.

Next.jsSupabaseAuthenticationCookies
3D illustration of a clock tower beside a systemd gear node with two overlapping job bricks and an amber lock gate
Linux

systemd Timers vs Cron: Missing PATH, Overlapping Runs, Time Drift

Cron runs a bare shell with no profile and no locking, and systemd reads the system time zone. The environment, single-instance and schedule fixes for both.

LinuxCronsystemdOperations
3D illustration of a commit chain with one cube floating detached above it and a rejected push arrow
Git

Git Detached HEAD and Non-Fast-Forward Push Rejected

A detached HEAD records commits on no branch, and a rejected push protects commits you do not have. Recover with a branch and reflog; integrate before pushing.

GitVersion ControlRecoveryCI
3D illustration of a future cube blocked from crossing a gap between two thread rails with a red cross
Rust

Rust: Future Cannot Be Sent Between Threads Safely in Tokio

spawn needs Send + 'static, and any non-Send value alive across an await breaks it. Shorten the guard, switch the lock, or move the work to a LocalSet.

RustTokioAsyncConcurrency
3D illustration of a stopwatch node with a severed cyan wire trailing into a pile of glowing goroutine dots
Go

Go context.DeadlineExceeded vs Canceled and Goroutine Leaks

A deadline is retryable and a cancellation is not, and both arrive wrapped. The errors.Is checks, the four handler timeouts, and the goroutine dump that names the leak.

GoConcurrencyContextDebugging
3D illustration of two module cubes facing each other with a hollow ring socket and a square plug that do not fit
Node.js

ERR_REQUIRE_ESM and __dirname Is Not Defined in ESM Projects

require of an ESM-only package has nothing to load, and ESM creates none of the CommonJS wrapper globals. Dynamic import, createRequire, and the path replacements.

Node.jsESMCommonJSModules