miniflare
miniflare copied to clipboard
Logs inside of Durable Object are not printed
In the miniflare v1, the console.log invocations inside of Durable objects are printed to the console. In version 2.0.0-rc.4 that is not happening
Hey! 👋 This is super strange, the Node.js console
object is passed directly into the sandbox without any Miniflare-modifications, so it should always behave exactly as it does in Node. Would you be able to share your code somehow, or create a minimal repoduction?
I think if you just add the console.log inside of the fetch function in a Durable object will be enough to reproduce
async fetch(request: Request): Promise<Response> {
console.log(`DO Request: ${JSON.stringify(request)}`);
return new Response(null, { status: 204 });
}
When I execute this code with wrangler I got this log message DO Request: {"signal":{"aborted":false},"fetcher":{},"redirect":"manual","headers":{},"url":"https://fake-host/","method":"GET","bodyUsed":false,"body":null}
with miniflare I don't get any message in console PS: I test this with miniflare version 2.2.0
Hey! :wave: I know it's been a while but I still can't reproduce this. Is this still an issue for you?
Hey! Thanks for raising this issue! I'm going to close it for now since we haven't heard from you in a while, but if there's still outstanding questions feel free to comment with a minimal reproduction and we can open it again and investigate further.