forwardemail / forwardemail/supertest

Keep getting error: "invalid json response body at reason: Unexpected end of JSON input"

Open
#701 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

```
FetchError: invalid json response body at reason: Unexpected end of JSON input

at node_modules/node-fetch/lib/index.js:272:32
```

Here is my code:
```
const response = await request(app)
.get('/api/demos')
.expect(200);
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the request shown against the /api/demos endpoint and inspect the response body and headers. Read the node_modules/node-fetch/lib/index.js stack location and determine whether the failure is in the endpoint response or Supertest's handling; done means the cause and a concrete project change are identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.