From ba453a47f7faacbb82a1152b22be7be12fb7de78 Mon Sep 17 00:00:00 2001 From: Alex Robinson Date: Tue, 10 Oct 2023 10:13:53 -0500 Subject: [PATCH] Warn that Hyperdrive bindings do not yet work in local dev Support is already in progress (see https://github.com/cloudflare/workerd/pull/1266) and should be coming in the next few weeks, but we've already had at least one user get very confused by this and cause us to spend time on debugging before realizing the problem was that they were talking about problems in wrangler dev rather than at the edge. This is an easy way to attempt to mitigate that for now. --- .changeset/tall-dodos-join.md | 5 +++++ packages/wrangler/src/dev/dev.tsx | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changeset/tall-dodos-join.md diff --git a/.changeset/tall-dodos-join.md b/.changeset/tall-dodos-join.md new file mode 100644 index 000000000000..a144812d155d --- /dev/null +++ b/.changeset/tall-dodos-join.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +Log a warning when using a Hyperdrive binding in local wrangler dev diff --git a/packages/wrangler/src/dev/dev.tsx b/packages/wrangler/src/dev/dev.tsx index 625260d92ae3..9821bb5cd8db 100644 --- a/packages/wrangler/src/dev/dev.tsx +++ b/packages/wrangler/src/dev/dev.tsx @@ -366,6 +366,12 @@ function DevSession(props: DevSessionProps) { ); } + if (props.local && props.bindings.hyperdrive?.length) { + logger.warn( + "Hyperdrive does not currently support 'wrangler dev' in local mode at this stage of the beta. Use the '--remote' flag to test a Hyperdrive configuration before deploying." + ); + } + const announceAndOnReady: typeof props.onReady = async ( finalIp, finalPort,