Skip to content

🐛 BUG: console.dir support #2247

@Cherry

Description

@Cherry

Which Cloudflare product(s) does this pertain to?

Wrangler core

What version(s) of the tool(s) are you using?

3.15.0

What version of Node are you using?

20.9.0

What operating system are you using?

Windows 11

Describe the Bug

Much improved console logging landed in cloudflare/workers-sdk#3591 which is fantastic, but it seems a small regression (ish) has been introduced with console.dir. The output with 3.14.0 wasn't really useful anyway, so this is very minor.

Script:

export default {
	fetch(request) {
		console.dir({
			foo: {
				bar: {
					baz: {
						foo: {
							bar: true
						}
					}
				}
			}
		}, {depth: null})
		return new Response('ok');
	}
}

I then spun up various versions of wrangler and hit each of them once to get the log:

wrangler 2 (npx wrangler@2.20.1 dev --local logging.js):

{
  foo: {
    bar: { baz: { foo: { bar: true } } }
  }
}

wrangler 3.14.0 (npx wrangler@3.14.0 dev logging.js)

[ 'Object', '{\n  foo: Object\n}', 'Object', '{\n  depth: null\n}' ]

wrangler 3.15.0 (npx wrangler@3.15.0 dev logging.js)


(intentionally empty. Nothing happens, it doesn't error, it just seems to swallow it entirely)

Ideally, this would be supported and work like wrangler 2.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions