DashboardcliAlways guard Node.js API availability a…

Always guard Node.js API availability at module top-level

Category: preference
Confidence: 1.00
ID: 019f6b0e-5bf8-794e-9ff8-bc5565499e2f
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 0
Source session: 0mwQmFM4Rry2OuPS9
Created: 2026-07-16 13:12:11
Updated: 2026-08-21 13:26:37

Content

User consistently identifies and fixes module-level calls to Node.js APIs that may not exist in certain versions. They require wrapping such calls in runtime availability checks (e.g., typeof api === 'function') to prevent import-time crashes. This applies particularly to newer APIs like zlib.zstdCompress that aren't available in older Node.js versions.

Move to: