Skip to content

Commit dd40f4c

Browse files
committed
docs: add note to set CLOUDFLARE_ENV for wrangler to load correct env vars
1 parent c6183ad commit dd40f4c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/start/framework/react/guide/environment-variables.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ TanStack Start automatically loads environment files in this order:
9898
.env # Default variables (commit to git)
9999
```
100100

101+
> [!TIP]
102+
> When using the Cloudflare Vite plugin, set `CLOUDFLARE_ENV` to ensure Wrangler loads the correct environment
103+
>
104+
> ```bash
105+
> # .env.development
106+
> CLOUDFLARE_ENV=development
107+
> ```
108+
>
109+
> Otherwise, the variables defined in your `.env.<environment>` files may not be read or injected into `process.env`
110+
101111
### Example Setup
102112

103113
**.env** (committed to repository):

docs/start/framework/solid/guide/environment-variables.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ TanStack Start automatically loads environment files in this order:
9898
.env # Default variables (commit to git)
9999
```
100100

101+
> [!TIP]
102+
> When using the Cloudflare Vite plugin, set `CLOUDFLARE_ENV` to ensure Wrangler loads the correct environment
103+
>
104+
> ```bash
105+
> # .env.development
106+
> CLOUDFLARE_ENV=development
107+
> ```
108+
>
109+
> Otherwise, the variables defined in your `.env.<environment>` files may not be read or injected into `process.env`
110+
101111
### Example Setup
102112

103113
**.env** (committed to repository):

0 commit comments

Comments
 (0)