Duplicates
Latest version
Current behavior 😯
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
Expected behavior 🤔
no error
Steps to reproduce 🕹
create an api endpoint at src/routes/test.ts:
import type { APIEvent } from "@solidjs/start/server";
export async function GET(event: APIEvent) {
event.nativeEvent.respondWith(
Response.json({ message: "Optimistically sent a message!" })
);
await fetch("https://jsonplaceholder.typicode.com/todos/1");
}
refresh few times quickly to make sure you get the bug
Context 🔦
No response
Your environment 🌎
Duplicates
Latest version
Current behavior 😯
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
Expected behavior 🤔
no error
Steps to reproduce 🕹
create an api endpoint at
src/routes/test.ts:refresh few times quickly to make sure you get the bug
Context 🔦
No response
Your environment 🌎