Premature close
See original GitHub issuePrerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
3.27.4
Plugin version
4.0.1
Node.js version
16.13.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.0.1
Description
Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
at new NodeError (node:internal/errors:371:5)
at Duplexify.onclose (node:internal/streams/end-of-stream:135:30)
at Duplexify.emit (node:events:402:35)
at Duplexify.emit (node:domain:475:12)
at Duplexify._destroy (/Users/gajus/Documents/dev/contra/contra-web-app/node_modules/duplexify/index.js:199:8)
at /Users/gajus/Documents/dev/contra/contra-web-app/node_modules/duplexify/index.js:182:10
at processTicksAndRejections (node:internal/process/task_queues:78:11)
Steps to Reproduce
This appears to happen when request is aborted while still serving the file.
Expected Behavior
Should produce a warning, but not an uncaught error.
Issue Analytics
- State:
- Created 2 years ago
- Comments:36 (21 by maintainers)
Top Results From Across the Web
npm ERR! premature close when using npm install
In my case, the package I was trying to install had a dependency on a Git repository that didn't have a package.json defined...
Read more >"premature close" error during npm install from git url #1 - GitHub
I know/see, that this repo doesn't have package.json, and I do npm install https://github.com/coryetzkorn/state-svg-defs.git Also tried ssh.
Read more >[Gatling 3.0.-RC2] Premature close - Google Groups
You get a "Premature close": either when we've received a partial response, then the connection was closed; or we've reach the maximum number...
Read more >Premature closure? Not so fast - BMJ Quality & Safety
When a physician makes a challenging diagnosis with just a few pieces of information, she is called a brilliant diagnostician. If her diagnosis...
Read more >Premature Closure: Was It Just Syncope? | PSNet
Premature closure — the acceptance of a diagnosis before it has been objectively established and alternative diagnoses have been fully ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Too late to the party, but Google sent me here, so I’ll post a comment in case someone else would end up here as well.
Got the same error after migrating to
fastify
4 and@fastify/compress
6. I didn’t want to remove@fastify/compress
as I find it super nice (although the error was gone after I tried commenting it out 🤷♂️). What fixed it for me is following this instructions from fastify Migration guide:So basically repace
with
After this, my requests started working, compression is working as well.
https://github.com/fastify/fastify/releases/tag/v3.29.1 has the backport 🎉