© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•3y ago•
1 reply
x0nifo

How to access env variable containing an object

I have the following in my .dev.vars file:
FOO = { bar = true, baz = 5}
FOO = { bar = true, baz = 5}
and now I'm trying to access it from my Worker, with
env.FOO.bar
env.FOO.bar
but that doesn't work (returns
undefined
undefined
).
Any ideas?
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

Workers not getting access to the env object
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2y ago
Hono and an empty env variable
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
13mo ago
Env variable confusion
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
6mo ago
Hono env access
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
13mo ago