Skip to content
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

Browser hangs if pug templates are used #12

Open
rajasegar opened this issue Apr 17, 2021 · 4 comments
Open

Browser hangs if pug templates are used #12

rajasegar opened this issue Apr 17, 2021 · 4 comments

Comments

@rajasegar
Copy link

Have you checked with pug, I think there may be some problem when using res.end() and the response is not flushed with the last chunk, the browser hangs for a long time without any error and the last chunk is not sent to the browser.

@rajasegar
Copy link
Author

This is my code

stream.useAllAutoTags(true);
stream.streamBefore('_header');
stream.streamAfter('_footer');

app.get('/', stream.stream(), (req,res) => {
  res.stream('index');
  res.end
});

@jpodwys
Copy link
Owner

jpodwys commented Apr 20, 2021

I haven't touched this project in years, so I'm not as familiar as I once was. That said, I did notice a difference between your code snippet and the readme. You may need to update your code snippet by replacing res.end with res.close();.

@rajasegar
Copy link
Author

I am afraid that won't work due to the res.close method not available anymore
Related to #11

@jpodwys
Copy link
Owner

jpodwys commented Apr 21, 2021

Oh thanks, you're right. I did notice that your code snippet doesn't call res.end as a function. Can you double check that you're calling res.end(); with parenthesis?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants