am I using <HttpHeader/> correctly?

I setup a new SolidStart project withpnpm create solid and selected the basic option. I modified src/routes/index.tsx to add <HttpHeader name="x-foo" value="bar"/> like so:
import { Title } from "@solidjs/meta";
import { HttpHeader } from "@solidjs/start";
import Counter from "~/components/Counter";

export default function Home() {
return (
<main>
<Title>Hello World</Title>
<HttpHeader name="x-foo" value="bar"/>
<h1>Hello world!</h1>
<Counter />
<p>
Visit{" "}
<a href="https://start.solidjs.com" target="_blank">
start.solidjs.com
</a>{" "}
to learn how to build SolidStart apps.
</p>
</main>
);
}
import { Title } from "@solidjs/meta";
import { HttpHeader } from "@solidjs/start";
import Counter from "~/components/Counter";

export default function Home() {
return (
<main>
<Title>Hello World</Title>
<HttpHeader name="x-foo" value="bar"/>
<h1>Hello world!</h1>
<Counter />
<p>
Visit{" "}
<a href="https://start.solidjs.com" target="_blank">
start.solidjs.com
</a>{" "}
to learn how to build SolidStart apps.
</p>
</main>
);
}
I then ran pnpm dev but as soon as I visit localhost:3000 in the browser, Vinxi crashes with the message Error: Cannot remove headers after they are sent to the client what am I doing wrong?
0 Replies
No replies yetBe the first to reply to this messageJoin