Skip to content

[Bug?]: ERR_HTTP_HEADERS_SENT #1855

@huseeiin

Description

@huseeiin

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

Your environment 🌎

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions