-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
adapter-node broken in next.153 #2239
Comments
This comment has been minimized.
This comment has been minimized.
It works fine in dev, but fails in production build, the following workaround works for me from const text = () => new TextDecoder(headers["content-encoding"] || "utf-8").decode(raw); to const text = () => {
if (typeof raw === "string")
return raw;
return new TextDecoder(headers["content-encoding"] || "utf-8").decode(raw)
}; |
This comment has been minimized.
This comment has been minimized.
@benmccann Has the latest version of |
I can't reproduce the issue. |
Sorry, I forgot to update the dependencies of my testing repo. The issue can be reproduced, and its here: Here is the build output of function getRawBody(req) {
return new Promise((fulfil, reject) => {
const h2 = req.headers;
if (!h2["content-type"]) {
return fulfil("");
}
req.on("error", reject);
const length = Number(h2["content-length"]);
if (isNaN(length) && h2["transfer-encoding"] == null) {
return fulfil("");
}
// ....
req.on("end", () => {
const [type] = (h2["content-type"] || "").split(/;\s*/);
if (isContentTypeTextual(type)) {
const encoding3 = h2["content-encoding"] || "utf-8";
return fulfil(new TextDecoder(encoding3).decode(data));
}
fulfil(data);
}); So yes, the issue should be fixed by releasing a new version of But that got me curious: Why does |
I think it's because |
thanks for tracking this down. I've kicked off a new release |
Describe the bug
I recently updated kit from next.151 to next.153 and now I am seeing an odd error when I submit a POST request to an endpoint:
This error causes the server to terminate.
Everything in this code path has worked fine for a couple months, all the way up to next.151. I've verified that the error only occurs in adapter-node, not under dev/preview. This issue renders my app unusable so I've reverted to next.151 until I can figure out what's going on. It could be something in my code but seems more likely to be an issue with adapter-node.
Reproduction
I'll work on this but wanted to report it first because this is a serious bug.
Logs
No response
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: