π BUG: Logging a websocket message from a durable object logs a scary warning
threepointone opened this issue Β· comments
Which Cloudflare product(s) does this pertain to?
Wrangler core, Miniflare
What version(s) of the tool(s) are you using?
wrangler@3.15.0
What version of Node are you using?
v18.19.0
What operating system and version are you using?
Mac OS
Describe the Bug
Observed behavior
I made a Durable Object, and connected to it with a websocket. The object responds to 'ping' with 'pong'. Pretty simple. Logging the event in the message handler logs a super scary warning
<Formatting threw (Error: Failed to get the 'ports' property on 'MessageEvent': the property is not implemented.
at MessageEvent.formatJsgResourceType (node-internal:internal_inspect:2188:31)
at formatValue (node-internal:internal_inspect:660:49)
at inspect (node-internal:internal_inspect:246:12)
at formatWithOptionsInternal (node-internal:internal_inspect:2047:44)
at formatWithOptions (node-internal:internal_inspect:1916:12)
at formatLog (node-internal:internal_inspect:2136:16)
at null.<anonymous> (file:///***/src/index.ts:48:13)>
Expected behavior
It probably shouldn't log that warning? If that field hasn't been implemented yet it should probably just be ignored.
Steps to reproduce
- Checkout https://github.com/threepointone/scary-wrangler-error-log
npm install && npm run dev
open http://localhost:8787
- look at the terminal console
Please provide a link to a minimal reproduction
https://github.com/threepointone/scary-wrangler-error-log
Please provide any relevant error logs
No response
Hey! π Thanks for reporting this. Yeah, this definitely shouldn't be happening. Will transfer this to workerd
since that's where the problem is, but should be able to fix this. π
When I run this on wrangler@3.14.0
I get
MessageEvent {
data: undefined,
ports: undefined,
source: undefined,
lastEventId: undefined,
origin: undefined
}
But it breaks on wrangler@3.15.0
or greater.
@mrbbot it looks like you made a few changes to console.log()
in both workers-sdk and workerd that went into that release. Sorry for the tag if you're already looking into it, just commenting since I was assigned to this issue at some point.