workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🚀 Feature Request: Wrangler should suggest re-running commands with `WRANGLER_LOG=debug`

Open irvinebroque opened this issue 2 years ago • 7 comments

Which Cloudflare product(s) does this pertain to?

Wrangler

What version of Wrangler are you using?

2.6.2

What operating system are you using?

Mac

Describe the Bug

Ran wrangler dev, and it exited without telling me anything:

➜  wrangler dev
 ⛅️ wrangler 2.6.2 
-------------------

Ran it again with WRANGLER_LOG=debug, and it exposed a missing .env file:

➜  WRANGLER_LOG=debug wrangler dev   
Failed to load .env file ".env": Error: ENOENT: no such file or directory, open '.env'
    at Object.openSync (node:fs:584:3)
    at Object.readFileSync (node:fs:452:35)
    at tryLoadDotEnv (/Users/birvine-broque/src/project/node_modules/wrangler/wrangler-dist/cli.js:140305:72)
    at loadDotEnv (/Users/birvine-broque/src/project/node_modules/wrangler/wrangler-dist/cli.js:140313:12)
    at /Users/birvine-broque/src/project/node_modules/wrangler/wrangler-dist/cli.js:164454:20
    at /Users/birvine-broque/src/project/node_modules/wrangler/wrangler-dist/cli.js:151146:16
    at maybeAsyncResult (/Users/birvine-broque/src/project/node_modules/wrangler/wrangler-dist/cli.js:149426:44)
    at /Users/birvine-broque/src/project/node_modules/wrangler/wrangler-dist/cli.js:151145:14
    at /Users/birvine-broque/src/project/node_modules/wrangler/wrangler-dist/cli.js:149414:22
    at Array.reduce (<anonymous>) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '.env'
}
 ⛅️ wrangler 2.6.2 
-------------------

Seems better for Wrangler to expose this error (even if ugly) than to swallow and hide it, if it's fatal?

irvinebroque avatar Jan 04 '23 21:01 irvinebroque