fix(remix-dev/vite): don't trigger request abort signal on dev server response close #8130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up #8062
In the previous PR, I blindly copied the code around
AbortController
frompackages/remix-express/server.ts
, but the way chaining "response close" to "request abort" might have unintended issues.I was testing
entry.server.cloudflare.tsx
on vite dev and I expected it to work on node 18, but I found that it produces a following error log for each request (though response succeeds and the app is still functional). I initially thought this is due toinstallGlobals
, but I saw a similar log even without it.And logs without "installGlobals"
This seems to be due to stream close event circling back by the following chain
response body ReadableStream close -> node http ServerResponse close -> AbortController.abort -> response body ReadableStream close
where 3rd (the last) chain is coming from:remix/packages/remix-dev/config/defaults/entry.server.cloudflare.tsx
Lines 13 to 16 in 58412d3
I think 2nd chain is the unnecessary one and I'm thinking to remove it since this one was not also present in the version before #8062 which was based on solit-start.
testing strategy
I verified the log disappears after applying a patch in hi-ogawa/remix-vite-deployment-examples#7
I tested both with and without
installGlobals
.