1

I use express.js(version 4.15.3) with node 8.1.2. I try to print a 10-mb object in json:

import express=require('express');

function handler=async (req,res)=> {
   try {
       let largeObject=await someFunctionThatReturnsLargeObject(); //just for the example
       message=(JSON.stringify(largeObject));
   }
   catch(e) {
       //has been debugged, it never gets here. it prints an error.
   }
   finally {
    res.end(message);
   }
}

I use typescript 2.3

sometimes when I call for a request from this handler, only part of the content is printed, and I get

net::ERR_CONTENT_LENGTH_MISMATCH

.

what do I do wrong?

Farhan Yaseen
  • 2,507
  • 2
  • 22
  • 37
reactvi
  • 11
  • 4

0 Answers0