-
Notifications
You must be signed in to change notification settings - Fork 406
Closed
Labels
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the 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