forwardemail / forwardemail/supertest

Error: write EPIPE on large files - Next.js + Jest + Supertest

Open
#824 3 comments 7 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug

**Node.js version:** v18.14.2

**OS version:** macOS 13.4

**Description:** With Next.js + Jest + Supertest, when attaching a 10mb file to my post request I'm getting the error "write EPIPE"

## Actual behavior

Test fails with the error "write EPIPE"

Screenshot 2023-07-24 at 8 42 24 PM

## Expected behavior

Test should succeed with no error

## Code to reproduce

https://github.com/dasveloper/next-test-supertest

```
await testClient(endpointHandler)
.post("/endpoint")
.field("name", "John Doe")
.attach("avatar", Buffer.from("a".repeat(10000000)), "filename")
.expect({ success: true })
.expect(200);
```

## Checklist

- [x] I have searched through GitHub issues for similar issues.
- [x] I have completely read through the README and documentation.
- [x] I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.