© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
The doc says: "any vars key are exposed as global variables", but they are not - Cloudflare Developers
CD
Cloudflare Developers
•
15mo ago
•
16 replies
ch3coohlink
The doc says: "any vars key are exposed as global variables", but they are not
I want to define something like DEV
=true to detect dev mode
(followed by some different initiating path
)
, but access variable
"DEV
" in top level code just cause
:
"ReferenceError
: DEV is not defined
"
.
Is this a misunderstanding of the doc
? I
'm confused
, the doc is in
https://developers.cloudflare.com/workers/wrangler/environments/#staging-and-production-environments
Cloudflare Docs
Environments · Cloudflare Workers docs
Deploy the same Worker application with different configuration for each environment
.
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
87,353
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Global vars
CD
Cloudflare Developers / workers-and-pages-help
3y ago
Workers are not global
CD
Cloudflare Developers / workers-and-pages-help
10mo ago
variables not updating
CD
Cloudflare Developers / workers-and-pages-help
3y ago
Secret variables in `.npmrc` are not loaded, build fails
CD
Cloudflare Developers / workers-and-pages-help
9mo ago