You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.trace is a really nice method for logging within functions and getting a stack-trace back to see where and how something was called. In complex workers apps, this would be very helpful.
console.trace calls are swallowed and log nothing.
Expected behavior
A trace should be logged, like in versions <= 3.14.0:
Trace: test
at logConsoleMessage (C:\Users\james\AppData\Local\npm-cache\_npx\51f9f4bffffff67a\node_modules\wrangler\wrangler-dist\cli.js:128126:25)
at WebSocket2.<anonymous> (C:\Users\james\AppData\Local\npm-cache\_npx\51f9f4bffffff67a\node_modules\wrangler\wrangler-dist\cli.js:127835:13)
at callListener (C:\Users\james\AppData\Local\npm-cache\_npx\51f9f4bffffff67a\node_modules\wrangler\wrangler-dist\cli.js:107228:18)
at WebSocket2.onMessage (C:\Users\james\AppData\Local\npm-cache\_npx\51f9f4bffffff67a\node_modules\wrangler\wrangler-dist\cli.js:107163:13)
at WebSocket2.emit (node:events:530:35)
at Receiver2.receiverOnMessage (C:\Users\james\AppData\Local\npm-cache\_npx\51f9f4bffffff67a\node_modules\wrangler\wrangler-dist\cli.js:108231:24)
at Receiver2.emit (node:events:518:28)
at Receiver2.dataMessage (C:\Users\james\AppData\Local\npm-cache\_npx\51f9f4bffffff67a\node_modules\wrangler\wrangler-dist\cli.js:106513:18)
at Receiver2.getData (C:\Users\james\AppData\Local\npm-cache\_npx\51f9f4bffffff67a\node_modules\wrangler\wrangler-dist\cli.js:106442:21)
at Receiver2.startLoop (C:\Users\james\AppData\Local\npm-cache\_npx\51f9f4bffffff67a\node_modules\wrangler\wrangler-dist\cli.js:106183:26)
(arguably not that useful since that's not userland code, but at least you get something)
which is okay... but it is littered with a tonne of middleware and facades that are of no relevance to me directly:
Error
at foo (file:///E:/GitHub/misty-heart-08d6/src/index.ts:4:16)
at Object.fetch (file:///E:/GitHub/misty-heart-08d6/src/index.ts:6:3)
at fetchDispatcher (file:///E:/GitHub/misty-heart-08d6/.wrangler/tmp/bundle-owSc75/middleware-loader.entry.ts:56:17)
at __facade_invokeChain__ (file:///C:/Users/james/AppData/Local/npm-cache/_npx/357954942dbe55d3/node_modules/wrangler/templates/middleware/common.ts:53:9)
at Object.next (file:///C:/Users/james/AppData/Local/npm-cache/_npx/357954942dbe55d3/node_modules/wrangler/templates/middleware/common.ts:50:11)
at jsonError (file:///C:/Users/james/AppData/Local/npm-cache/_npx/357954942dbe55d3/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:30)
at __facade_invokeChain__ (file:///C:/Users/james/AppData/Local/npm-cache/_npx/357954942dbe55d3/node_modules/wrangler/templates/middleware/common.ts:53:9)
at Object.next (file:///C:/Users/james/AppData/Local/npm-cache/_npx/357954942dbe55d3/node_modules/wrangler/templates/middleware/common.ts:50:11)
at drainBody (file:///C:/Users/james/AppData/Local/npm-cache/_npx/357954942dbe55d3/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:30)
at __facade_invokeChain__ (file:///C:/Users/james/AppData/Local/npm-cache/_npx/357954942dbe55d3/node_modules/wrangler/templates/middleware/common.ts:53:9)
In production with wrangler tail, I do get something reasonable with this workaround:
(log) Error
at foo (index.js:5:19)
at Object.fetch (index.js:7:5)
but console.trace calls are just swallowed in production too.
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
3.53.1
What version of Node are you using?
20.12.2
What operating system and version are you using?
Windows 11
Describe the Bug
console.trace
is a really nice method for logging within functions and getting a stack-trace back to see where and how something was called. In complex workers apps, this would be very helpful.Reference: https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static
Observed behavior
console.trace
calls are swallowed and log nothing.Expected behavior
A trace should be logged, like in versions <= 3.14.0:
(arguably not that useful since that's not userland code, but at least you get something)
Steps to reproduce
Using the following script:
npx [email protected] dev
- logs a tracenpx [email protected] dev
- no trace, no error, just swallowednpx [email protected] dev
- no trace, no error, just swallowedI previously opened this as a feature request at cloudflare/workers-sdk#5761, but have since realised this is a regression.
Related: #2247
The text was updated successfully, but these errors were encountered: