This bug was absolutely crazy to track down. Essentially ServerResponse should have the finished = false; set at least on instantiation. When trying to get an Express.js application to work, some of the streaming code looks for that finished property. If it is not there, then it thinks that the read stream is instantly finished and sets a macro task for execution. This terminates the read stream right away and breaks the functionality. Simply adding that property to ServerResponse fixes the issue for me.
We should probably ensure that these Node data structures have all original properties at least initialized, even if they are not used.
This bug was absolutely crazy to track down. Essentially
ServerResponse
should have thefinished = false;
set at least on instantiation. When trying to get an Express.js application to work, some of the streaming code looks for that finished property. If it is not there, then it thinks that the read stream is instantly finished and sets a macro task for execution. This terminates the read stream right away and breaks the functionality. Simply adding that property toServerResponse
fixes the issue for me.We should probably ensure that these Node data structures have all original properties at least initialized, even if they are not used.