Skip to content

Commit 07efcac

Browse files
add hack not to break wrangler pages dev
1 parent 443b6cb commit 07efcac

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/wrangler/src/dev/start-dev.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,14 @@ async function setupDevEnv(
249249
auth,
250250
remote:
251251
args.remote || (args.forceLocal || args.local ? false : undefined),
252-
localBindingsOnly: !!args.forceLocal,
252+
localBindingsOnly:
253+
// Note: this ternary is a hack, just to make sure that `wrangler pages dev`
254+
// supports the AI binding (the issue is that `wrangler pages dev` sets
255+
// `forceLocal` to true, so it should disable all remote bindings, but it
256+
// still needs to support the AI bindings regardless because removing such
257+
// support now would be a breaking change)
258+
// TODO: remove this hack in wrangler v5 (the following line should just be `!!args.forceLocal,`)
259+
args.enablePagesAssetsServiceBinding ? false : !!args.forceLocal,
253260
server: {
254261
hostname: args.ip,
255262
port: args.port,

0 commit comments

Comments
 (0)