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
mattpOP16mo 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
windwp16mo ago
it is correct on sveltekit docs:)
mattp
mattpOP16mo ago
The sveltekit docs are so well-written omg
Want results from more Discord servers?
Add your server