Suppress errors of missing .env file for production
See original GitHub issueProduction environments normally don’t have a .env file. In these cases require('dotenv').load()
prints the following error to console:
{ [Error: ENOENT, no such file or directory '.env'] errno: -2, code: 'ENOENT', path: '.env', syscall: 'open' }
Shouldn’t these errors be suppressed or at least change into something less frightening?
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
dotenv file is not loading environment variables - Stack Overflow
Here my project structure is like this. // index. ts import dotenv from 'dotenv'; import path from 'path'; dotenv. config({path: path.
Read more >Missing Environment Variables Error. - Atlassian Community
Solved: Hello, I have created Environments in deployments namely Development and Production which are using different aws accounts for ...
Read more >Dot Env Files: The Silent Killer - Tighten Co.
Solution: A command that runs in CI during a build that catches . env. example variables missing from the environment's . env file,...
Read more >Configure Meilisearch at launch
To configure a Meilisearch instance using environment variables, ... Ignore missing dump. WARNING. This option does not take any values.
Read more >Scan Environment Variables in Production Application
Ignore Environment Variable ... When you run the application in different environments that time you might want to ignore some environment ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fixed with #62 release v.1.1.0
now you can silence dotenv
@calebboyd thanks for the hint, I did not know this trick existed. Looks like in v3.0.0 this is no longer the case though. Errors are not shown by default unless you pass a
verbose
option.