Deno Deploy: Oak shows "[uncaught application error]: UnexpectedEof - early eof" after idle

An Oak server deployed on Deno Deploy kept emitting [uncaught application error]: UnexpectedEof - early eof, always at the end of the logs after the app had been idle for about 15 seconds. It was not reproducible locally, on Fly.io, or on self-hosted VMs — only on Deno Deploy — and it did not appear to affect the site itself, just noisy red logs. Multiple users on Oak 10.x reported the same behavior.

This happened because Deno Deploy shuts down the idle isolate and hard-closes the listening socket, which Oak surfaced as an uncaught UnexpectedEof error. Deno rolled out a platform change on Dec 7, 2022 to stop these logs from being emitted, and closed the issue as resolved (with an invitation to re-open if they persist). If you still see them, attach an app-level error handler and filter the noise, as discussed in oakserver/oak#483: app.addEventListener("error", (e) => { / ignore UnexpectedEof / }). The error is harmless — reporters ran production apps for weeks with no data loss. Source: https://github.com/denoland/deploy_feedback/issues/179

Source: https://github.com/denoland/deploy_feedback/issues/179