From 69339ab401ed22aa2163ae4d16bb77b6e7fefead 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 00000000000..a144812d155 --- /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 f74cb8380f5..de32921899f 100644 --- a/packages/wrangler/src/dev/dev.tsx +++ b/packages/wrangler/src/dev/dev.tsx @@ -296,6 +296,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 = (finalIp, finalPort) => { if (process.send) { process.send(