Skip to content

FAQ and Troubleshooting

Abhijeet Kumar edited this page Nov 20, 2026 · 1 revision

FAQ and Troubleshooting

Why is DEBUG=false truthy in plain Node.js?

Every process.env value is a string, and the string "false" is truthy. env-saaf's boolean type converts it to a real false.

Why did my app fail in production instead of at startup?

Without validation, a missing variable is only noticed by the first request that reads it. Validating once at startup with validateEnv turns that into one clear error at boot, listing every missing or invalid variable.

PORT behaves like a string — "3000" + 1 gives "30001"

That is string concatenation. The port (and number / int) types return real numbers.

My .env file has a duplicate key

parseEnvFile (and therefore loadEnv) reports duplicate keys instead of silently keeping the last one — duplicates are almost always a editing mistake.

A line in my .env file has no =

That is reported as an error too, rather than being silently dropped.

Does env-saaf have any dependencies?

No. Zero dependencies is a hard project rule — see Contributing Guide.

Where do I ask a question?

Use Discussions for questions and ideas, and Issues for bugs.

Clone this wiki locally