https developers cloudflare com pages

https://developers.cloudflare.com/pages/framework-guides/deploy-a-qwik-site/#use-bindings-in-your-qwik-application The example in this section is incorrect, it should be:
export const useKVData = routeLoader$(({ platform }) => {
// This is wrong:
// const { MY_KV } = (platform as { MY_KV: KVNamespace }));
const { MY_KV } = platform.env;
return {
// ....
}
});
export const useKVData = routeLoader$(({ platform }) => {
// This is wrong:
// const { MY_KV } = (platform as { MY_KV: KVNamespace }));
const { MY_KV } = platform.env;
return {
// ....
}
});
3 Replies
mattp
mattpOP2y ago
Took me hours to figure it out omg And it requires an additional setup if you want to use KV binding for local development
windwp
windwp2y ago
it is correct on sveltekit docs:)
mattp
mattpOP2y ago
The sveltekit docs are so well-written omg
Want results from more Discord servers?
Add your server