S
SolidJS2mo ago
omfj

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?
2 Replies
Tommypop
Tommypop2mo ago
GitHub
🚀 Improve the SolidStart Cloudflare (bindings) integration · Issue ...
Describe the solution Summary People deploying their SolidStart applications to Cloudflare Pages do not have a proper DX when it comes to accessing Bindings, it would be great if we could find a so...
omfj
omfj2mo ago
Thank you, @Tommypop !
Want results from more Discord servers?
Add your server