© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•3y ago
aydrian

Type safe context in Remix 2.0

I'm working a Remix 2.0 website deployed to Pages. I'm using KV but the context in the action and loader functions don't know about it. I'd rather not copy/paste
interface Env {
  CONTENT: KVNamespace;
}
...
 let env = context.env as Env;
interface Env {
  CONTENT: KVNamespace;
}
...
 let env = context.env as Env;

into every page. I've found posts like (https://tom-sherman.com/blog/type-safe-remix-cloudflare-loader-context) but those are from 1.x times and the server files seem different.
Has anyone done this?
Type safe context in Remix on Cloudflare Pages
Type safe context in Remix on Cloudflare Pages
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Remix, Cloudflare Pages and Context/Env variables
Cloudflare DevelopersCDCloudflare Developers / pages-help
3y ago
remix
Cloudflare DevelopersCDCloudflare Developers / pages-help
3y ago
Remix and Vite - 2 error(s) and 0 warning(s) when compiling Worker.
Cloudflare DevelopersCDCloudflare Developers / pages-help
2y ago
remix dev or remix build?
Cloudflare DevelopersCDCloudflare Developers / pages-help
3y ago