-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
renderToStream: NodeJS.ReadableStream will not complete, end event will not fire. #2706
Comments
Update: I also think that something under the hood is still operating and waiting because there is a memory leak when I try to execute the function multiple (a lot) times. |
Found the exact source of the problem. It had to do with loading a font family from a CDN. In my document component, I would have the following
Now, when I run the above, the document will not generate. My solution was to remove the OpenSans font family all together and just use the default Helvetica I hope this helps find the source of the problem. |
I'm running into the same, loading fonts from local, but still, using non-standard fonts. |
I can confirm in my case it's a duplicate of #2675 which is primarily worded as a front-end issue, but |
I have run into the same issue and its causing a major hiatus … @diegomura could you take a look? PS: I am asking because I have backed this project financially since 2017. |
Describe the bug
I am trying to create a pdf file on my backend and then serve it to my front end for download. Since renderToString has been deprecated, I am forced to use renderToStream. Then convert the stream to a buffer to send back in the response. I've tried sending the stream back directly in the response object but it throws an error.
in my renderToBuffer function, the "data" event triggers just fine for each chunk, however, when it's finished, the "end" event never fires. Nor does the "finish" event.
I have tried several different ways of reading the stream, I have tried renderToFile as well and it too freezes up. (I'm assuming it's the same problem internally when writing the file, reading the stream never triggers and end event.)
Any thoughts?
To Reproduce
See code above.
Expected behavior
I expect that the readable stream will actually finish when all the data has been read.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: