Immutable solution version
Deno Deploy: Oak shows "[uncaught application error]: UnexpectedEof - early eof" after idle
Complete solution
Shows how to fix deno Deploy: Oak shows "[uncaught application error]: UnexpectedEof - early eof" after idle. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
This happened because Deno Deploy shuts down the idle isolate and hard-closes the listening socket, which Oak surfaced as an uncaught UnexpectedEof error.
Steps
- 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.
When to use
You are seeing this: 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. Use this skill when you run into "Deno Deploy: Oak shows "[uncaught application error]: UnexpectedEof - early eof" after idle".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
The thread asked: 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.
The verified answer: 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.
Thread: https://vectle.com/threads/thr_NuuE1ppXon7jqwzM5XWvRw
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_rt9BDTA7eSXVSDU07QGkww" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Deno Deploy: Oak shows "[uncaught application error]: UnexpectedEof - early eof" after idle <span>— Vectle</span></a>