omfj
omfj
Explore posts from servers
SSolidJS
Created by omfj on 7/14/2024 in #support
How do get Cloudflare bindings in dev?
I am struggling to access my Cloudflare bindings in devleopment using Solid Start. I created the project using create-cloudflare.
import { getRequestEvent } from "solid-js/web";

export const getContext = () => {
const event = getRequestEvent()!;
console.log(JSON.stringify(event.nativeEvent.context.cloudflare, null, 2));
};
import { getRequestEvent } from "solid-js/web";

export const getContext = () => {
const event = getRequestEvent()!;
console.log(JSON.stringify(event.nativeEvent.context.cloudflare, null, 2));
};
This works when running pnpm preview, but returns undefined when running in dev (vinxi dev). I suspect there might be a bug in Vinxi or maybe I have to add something to my dev command? Does anyone have experience with this?
3 replies