Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/red-yaks-go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@opennextjs/cloudflare": patch
---

fix: regression where getEnvFromPlatformProxy received wrong options type

This fixes a regression introduced in [32ba91a](https://github.com/opennextjs/opennextjs-cloudflare/commit/32ba91a6d3fa6b9a8b2cd5a8c973c3b3eb1108f0) where `getEnvFromPlatformProxy` call sites passed `OpenNextConfig` even though the function expects Wrangler `GetPlatformProxyOptions`.

The fix restores the pre-[32ba91a](https://github.com/opennextjs/opennextjs-cloudflare/commit/32ba91a6d3fa6b9a8b2cd5a8c973c3b3eb1108f0) argument shape by passing `{ configPath, environment }` from CLI arguments, so env resolution follows the selected Wrangler config/environment.

It also adds explicit return type annotations to related CLI helpers to make declaration output stable and not rely on inference.
Comment thread
james-elicx marked this conversation as resolved.
Outdated
8 changes: 7 additions & 1 deletion packages/cloudflare/src/cli/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ export async function deployCommand(args: WithWranglerArgs<{ cacheChunkSize?: nu

const wranglerConfig = await readWranglerConfig(args);

const envVars = await getEnvFromPlatformProxy(config, buildOpts);
const envVars = await getEnvFromPlatformProxy(
{
configPath: args.wranglerConfigPath,
environment: args.env,
},
buildOpts
);

await populateCache(
buildOpts,
Expand Down
8 changes: 7 additions & 1 deletion packages/cloudflare/src/cli/commands/populate-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ async function populateCacheCommand(
const buildOpts = getNormalizedOptions(config);

const wranglerConfig = await readWranglerConfig(args);
const envVars = await getEnvFromPlatformProxy(config, buildOpts);
const envVars = await getEnvFromPlatformProxy(
{
configPath: args.wranglerConfigPath,
environment: args.env,
},
buildOpts
);

await populateCache(
buildOpts,
Expand Down
8 changes: 7 additions & 1 deletion packages/cloudflare/src/cli/commands/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ export async function previewCommand(
const buildOpts = getNormalizedOptions(config);

const wranglerConfig = await readWranglerConfig(args);
const envVars = await getEnvFromPlatformProxy(config, buildOpts);
const envVars = await getEnvFromPlatformProxy(
{
configPath: args.wranglerConfigPath,
environment: args.env,
},
buildOpts
);

await populateCache(
buildOpts,
Expand Down
Loading