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

[Docs]: Server Side Rendering example calls abort when request is closed instead of response #11248

Closed
faergeek opened this issue Feb 3, 2024 · 1 comment · Fixed by #11249
Labels

Comments

@faergeek
Copy link
Contributor

faergeek commented Feb 3, 2024

Describe what's incorrect/missing in the documentation

Server-Side Rendering Docs provide an example createFetchRequest function, which contains this line:

req.on("close", () => controller.abort());

And "close" event seems to actually be triggered as soon as body is read, but only in case there is a body (but may be I'm misunderstanding something, node docs are confusing to me on that part).

In my case it always aborts all requests which have body.

As a reference it mentions @remix-run/express package, which doesn't have this issue, because it listens to "close" event of response, not request:

https://github.com/remix-run/remix/blob/ae8845470cd88b7a62bd97879ad381bf8a6538e7/packages/remix-express/server.ts#L101C1-L101C45

@faergeek faergeek added the docs label Feb 3, 2024
@timdorr
Copy link
Member

timdorr commented Feb 3, 2024

Looks like this was fixed in remix-run/remix#3626 so we just need to match that change.

brophdawg11 pushed a commit that referenced this issue Feb 13, 2024
* docs: listen for close event on response, not request

Fixes #11248

* chore: update contributors.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants