Open kentcdodds opened 1 month ago
eventStream returns a Response object, so maybe they consider it a raw object?
Here's how they detect whether something is a response: https://github.com/remix-run/remix/blob/aabc7f84514c1c0e0ba8e33c48c7fba422cf8084/packages/remix-server-runtime/responses.ts#L107C1-L116C1
export function isResponse(value: any): value is Response {
return (
value != null &&
typeof value.status === "number" &&
typeof value.statusText === "string" &&
typeof value.headers === "object" &&
typeof value.body !== "undefined"
);
}
Perhaps one of those things is unset in the eventStream?
It has a headers object and body, but I never set a status and statusText, if that solves the issue it could be a quick change here, it can be just status 200 and statusText set to OK
doesn't new Response
default the status to 200 and statusText to OK?
Describe the bug
When Single Fetch is enabled, eventStream causes Remix to output an error:
Your Example Website or App
https://github.com/epicweb-dev/epicshop
Steps to Reproduce the Bug or Issue
Expected behavior
I expect no warnings
Screenshots or Videos
Platform
Additional context
It's possible this is an error in Remix's detection of returned responses.