question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Assertion Error: Headers already sent

See original GitHub issue

Code: https://gist.github.com/haxxorsid/348169a3a6c93ee241dfdb8170709651 Run:

git clone https://gist.github.com/haxxorsid/348169a3a6c93ee241dfdb8170709651.git
cd 348169a3a6c93ee241dfdb8170709651
npm install
npm start

In browser: http://localhost:3000/my-scale/resize/100/123?url=image.jpg It resizes image.jpg(without overwriting the file) to 100width & 123height and displays that in browser.

Error: AssertionError [ERR_ASSERTION]: headers have already been sent

Can someone solve this issue for me. Maybe this issue is not at all related to koajs.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
haxxorsidcommented, Dec 19, 2017

a9ade90862c01733bbd7f56e883eb60b18c899d6119a040bd58609f6ef0a0aad

1reaction
jeffijoecommented, Dec 19, 2017

Actually, instead of result.pipe(transformer).pipe(ctx.res), try ctx.body = result.pipe(transformer)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix 'headers already sent' error in node - Stack Overflow
searchEntry event is called once for each found item which means you are calling res.json multiple times. Try this: app.get('/api/ldapUsers' ...
Read more >
Cannot modify header information - headers already sent by
Sending header(s) in the test will cause an error: Cannot modify header information - headers already sent by (output started at ...
Read more >
What is the "headers already sent" PHP error? - KnownHost
When PHP receives the first output ( print , echo , <html> ) it will “flush” the collected headers. Afterward, it can send...
Read more >
How to Fix the "Cannot Modify Header Information - Kinsta
The first thing you need to do when you run into the “Cannot modify header information – headers already sent by” error is...
Read more >
HTTP Tests - Laravel - The PHP Framework For Web Artisans
Customizing Request Headers. You may use the withHeaders method to customize the request's headers before it is sent to the application. This method...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found