-
👋 Hello there. I am facing a weird bug with the logger middleware and Remix.
It seems to be React related. What is your guidance to submit a fix that I can't prove? 😅 |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 5 replies
-
I can confirm I am having the same issue in my project using remix. |
Beta Was this translation helpful? Give feedback.
-
Hi. Is this a Remix-specific matter? @sergiodxa Do you know anything about this? |
Beta Was this translation helpful? Give feedback.
-
This is what happen: // 1️⃣ console.log("log response from Remix requestHandler", response);
requestHandler _Response [Response] {
[Symbol(cache)]: [
200,
ReadableStream { locked: false, state: 'readable', supportsBYOB: false },
{ 'content-type': 'text/html' }
]
}
// 2️⃣ console.log("read status", response.status);
200
// 3️⃣ console.log("log response after reading status", response);
_Response [Response] {
[Symbol(responseCache)]: _Response [Response] {
[Symbol(realm)]: { settingsObject: {} },
[Symbol(state)]: {
aborted: false,
rangeRequested: false,
timingAllowPassed: false,
requestIncludesCredentials: false,
type: 'default',
status: 200,
timingInfo: null,
cacheState: '',
statusText: '',
headersList: [_HeadersList],
urlList: [],
body: [Object]
},
[Symbol(headers)]: _HeadersList {
cookies: null,
[Symbol(headers map)]: [Map],
[Symbol(headers map sorted)]: null
}
}
} Looks like the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation! I haven't fully tested it yet, but I wonder if it's because the application is using Node.js Adapter? |
Beta Was this translation helpful? Give feedback.
-
Yes, it could be a node-server issue, but I don't know. As far as I tried in unit tests, I couldn't confirm the problem even with readableStream. I don't know how defer() works in remix, but if 'Transfer-Encoding': 'chunked' is not set, I think the browser will not accept. But then, it would have nothing to do with
A simple project that could reproduce the problem might confirm it. |
Beta Was this translation helpful? Give feedback.
-
@rphlmr Thank you! I understand the situation. This is an hono/node-server issue. If c.res.status was not called, writeFromReadableStream() would have been used, but if called, it would have been written out after being buffered into arrayBuffer(). This is why it was not streaming anymore. We will begin to fix the problem. |
Beta Was this translation helpful? Give feedback.
-
@rphlmr |
Beta Was this translation helpful? Give feedback.
@rphlmr
Please try v1.8.0!
https://github.com/honojs/node-server/releases/tag/v1.8.0