packages/sdk/js/src/v2/client.ts:86 checks the content-type with strict equality:
client.interceptors.response.use((response) => {
const contentType = response.headers.get("content-type")
if (contentType === "text/html")
throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)")
return response
})
Servers normally send text/html; charset=utf-8, so the comparison fails and the guard never fires. The caller then gets a JSON parse error instead of the message explaining that the server version doesn't support the request.
contentType?.startsWith("text/html") fixes it. Happy to send a PR.
packages/sdk/js/src/v2/client.ts:86checks the content-type with strict equality:Servers normally send
text/html; charset=utf-8, so the comparison fails and the guard never fires. The caller then gets a JSON parse error instead of the message explaining that the server version doesn't support the request.contentType?.startsWith("text/html")fixes it. Happy to send a PR.