Skip to content

Commit f57bc4e

Browse files
[wrangler] fix: avoid getPlatformProxy logging twice that it is using vars defined in .dev.vars files (#7947)
when `getPlatformProxy` is called and it retrieves values from `.dev.vars` files, it logs twice a message like: `Using vars defined in .dev.vars`, the changes here make sure that in such cases this log only appears once
1 parent aa3ee63 commit f57bc4e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.changeset/gentle-foxes-float.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
fix: avoid `getPlatformProxy` logging twice that it is using vars defined in `.dev.vars` files
6+
7+
when `getPlatformProxy` is called and it retrieves values from `.dev.vars` files, it logs twice
8+
a message like: `Using vars defined in .dev.vars`, the changes here make sure that in such cases
9+
this log only appears once

packages/wrangler/src/api/integrations/platform/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { DEFAULT_MODULE_RULES } from "../../../deployment-bundle/rules";
55
import { getBindings } from "../../../dev";
66
import { getBoundRegisteredWorkers } from "../../../dev-registry";
77
import { getClassNamesWhichUseSQLite } from "../../../dev/class-names-sqlite";
8-
import { getVarsForDev } from "../../../dev/dev-vars";
98
import {
109
buildAssetOptions,
1110
buildMiniflareBindingOptions,
@@ -118,16 +117,11 @@ export async function getPlatformProxy<
118117

119118
const bindings: Env = await mf.getBindings();
120119

121-
const vars = getVarsForDev(rawConfig, env);
122-
123120
const cf = await mf.getCf();
124121
deepFreeze(cf);
125122

126123
return {
127-
env: {
128-
...vars,
129-
...bindings,
130-
},
124+
env: bindings,
131125
cf: cf as CfProperties,
132126
ctx: new ExecutionContext(),
133127
caches: new CacheStorage(),

0 commit comments

Comments
 (0)