miniflare icon indicating copy to clipboard operation
miniflare copied to clipboard

Logs inside of Durable Object are not printed

Open Moser-ss opened this issue 3 years ago • 2 comments

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

Moser-ss avatar Dec 25 '21 16:12 Moser-ss

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?

mrbbot avatar Dec 31 '21 18:12 mrbbot

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

Moser-ss avatar Jan 23 '22 11:01 Moser-ss

Hey! :wave: I know it's been a while but I still can't reproduce this. Is this still an issue for you?

mrbbot avatar Oct 17 '22 16:10 mrbbot

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.

penalosa avatar Jan 09 '23 16:01 penalosa