I'm having issues generating a local kv, it's with remix so I have added the --kv into the package.json wrangler script.
> cross-env NODE_ENV=development npm run wrangler --kv sessionStorage
> wrangler
> wrangler pages dev ./public "sessionStorage"
When I go to access the KV its undefined.
const handleRequest = createPagesFunctionHandler({
build,
mode: process.env.NODE_ENV,
getLoadContext: (context) => {
console.log("Session Storage");
console.log(context.env);
const sessionStorage = createWorkersKVSessionStorage({
kv: context.env.sessionStorage,
cookie: sessionCookie,
})
return { ...context.env, sessionStorage }
},
});