toddbluhm / env-cmd

Setting environment variables from a file
https://www.npmjs.com/package/env-cmd
MIT License
1.73k stars 65 forks source link

Need more helpful message when .env.js has error #340

Open siva-sankaran opened 2 years ago

siva-sankaran commented 2 years ago

When .env.js file throwing error like "Cannot find module '...' " , env-cmd tells us that "Failed to find .env file at path: {filePath}". This message is not telling the real issue.

Alternatively "Something went wrong when accessing env file path: ${filePath}" will be better. Can someone add your comments or correct this message with better English ?

https://github.com/toddbluhm/env-cmd/blob/66f3fa398685b83ef089532af3de67cc82d7b3ac/src/get-env-vars.ts#L38