Wrangler dev fails to properly log "at the"

This is an odd one, wondering if anyone else can reproduce this or if there’s something strange about my local setup. When I run wrangler dev in my terminal and console.log things in my worker, normally it works fine. But if the string that I’m passing to console.log contains “at the”, the terminal output gets truncated and includes [object Object] where the the should be. for example, in the worker:

            console.log('some normal text to log')
            console.log('text with at the in the middle')

gives this output in the terminal:

some normal text to log
text with at [object Object]

This only happens in the terminal. If I press the “open Devtools” key and watch the logs in the browser, the whole text gets logged fine. I’m using wrangler 3.22.1 which I believe is the latest.

It appears this happens with at followed by anything. at, a space, and then any text seems to get truncated to [object Object].

I’ve filed a bug at 🐛 BUG: Logs with `at ` get truncated to `at [object Object]` · Issue #4668 · cloudflare/workers-sdk · GitHub, thanks for the report. I’d recommend following that for updates.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.