solid-start
solid-start copied to clipboard
[Bug?]: ERR_HTTP_HEADERS_SENT
Duplicates
- [x] I have searched the existing issues
Latest version
- [x] 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
Your environment 🌎