Dashboardclizlib.zstdCompress module guard

zlib.zstdCompress module guard

Category: gotcha
Confidence: 1.00
ID: 01a08ab5-50d6-7cc1-b488-6df5078d5d1e
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 0
Source session: 1QLo0UWM3EmN2YDvF
Created: 2026-09-10 09:45:33
Updated: 2026-09-10 09:45:33

Content

Trap: referencing a newer Node.js API such as zlib.zstdCompress unconditionally at module scope looks safe when development uses a current runtime, but older supported Node.js versions crash during import before fallback logic runs. Fix: guard availability at module scope with typeof api === "function" and route unavailable APIs to the supported fallback.

Move to: