Below is the error I console from my client side.
{
"data": null,
"error": {
"message": "ReadableStream has already been used"
},
"headers": {
"access-control-allow-credentials": "true",
"access-control-allow-headers": "host, content-type, user-agent, connection, accept, accept-language, content-length, accept-encoding, authorization",
"access-control-allow-methods": "POST",
"access-control-expose-headers": "host, content-type, user-agent, connection, accept, accept-language, content-length, accept-encoding, authorization",
"content-length": "36",
"content-type": "text/plain;charset=utf-8",
"date": "Tue, 07 Oct 2025 08:28:18 GMT",
"vary": "Origin"
},
"response": {
"bodyUsed": true,
"ok": false,
"status": 500,
"statusText": "",
"type": "default",
"url": "http://000.000.00.110:4000/category"
},
"status": 500
}
The issue happened after I upgrade my dependency:
"name": "api",
"version": "1.0.50",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "bun run --watch src/index.ts",
"check-types": "tsc --noEmit",
"upgrade": "bunx npm-check-updates -u",
"lint": "eslint ."
},
"dependencies": {
"@elysiajs/cors": "^1.4.0",
"@elysiajs/openapi": "^1.4.11",
"@elysiajs/swagger": "^1.3.1",
"@sinclair/typebox": "^0.34.41",
"@workspace/database": "workspace:*",
"elysia": "1.4.9",
"elysia-clerk": "^0.12.2",
"eslint-config-prettier": "^10.1.8"
},
"devDependencies": {
"@eslint/js": "^9.37.0",
"@eslint/json": "^0.13.2",
"bun-types": "latest",
"eslint": "^9.37.0",
"globals": "^16.4.0",
"prisma": "^6.16.3",
"typescript": "^5.9.3",
"typescript-eslint": "^8.45.0"
},
"module": "src/index.js"
}
Basically, I started getting the
“ReadableStream has already been used”
error after upgrading all my dependencies. I noticed that if I revert Elysia from version 1.4.9 to 1.2.5, everything works fine. However, due to some reasons, I need to keep my dependencies updated.
After some testing, I found that removing .use(clerkPlugin()) fixes the issue — the API works again. But since I need authentication, removing clerkPlugin() isn’t a viable option.
name: "Category",
prefix: "/category",
})
.use(clerkPlugin())
.post(
"",
async ({ body }) => {
console.log("im second", body);
},
{
body: t.Object({
type: t.Enum({ EXPENSES: "EXPENSES", INCOME: "INCOME" }),
title: t.String(),
icon: t.Object({
name: t.String(),
set: t.String(),
}),
parentId: t.Optional(t.String()),
}),
}
);```