Repository navigation
fix(cloudflare/hyperdrive): only contribute the dev origin to local hosts - #1839
Merged
sam-goodwin merged 3 commits intoOct 6, 2026
Merged
Conversation
…osts `ConnectBinding` (and the async-Worker `env` path in `WorkerAsyncBindings`) always attached the `hyperdrives` dev-origin record to the host's bind data. That record is an `Output.map` that throws for an Access-protected origin with no `dev` override, and Apply evaluates every binding before reconciling the host, so `alchemy deploy` failed with "...not supported in development mode..." even though the live Worker provider never reads `hyperdrives`. The record is now contributed only when the host runs locally (`host.Mode ?? defaultProviderMode` is "local"), the same resolution the planner uses and the same gate `bindWorkerAsyncBindings` already applies to Access enrollment and `maybeQueueShim` to the queue shim. Fixes alchemy-run#1836 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gin end to end Postgres in Docker behind a Cloudflare Tunnel (cloudflared run locally), guarded by a self-hosted Access app admitting one service token. Both binding flavors bind the Connection without a dev override and query through it. Replaces the in-memory ConnectBinding.test.ts.
Contributor
|
Install the packages built from this commit: alchemypnpm install https://pkg.alchemy.run/alchemy/pr:1839:c5294bd@alchemy.run (6)pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@alchemy.run/floci/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:1839:c5294bd@distilled.cloud (16)pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/axiom/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/doppler/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/infisical/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/stripe/pr:1839:c5294bdpnpm install https://pkg.alchemy.run/@distilled.cloud/zerossl/pr:1839:c5294bdPublished |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1836
A Hyperdrive whose origin sits behind Cloudflare Access, with no
devoverride, now deploys:ConnectBinding, and the async-Workerenvpath inWorkerAsyncBindings, always attached thehyperdrivesdev-origin record to the host's bind data. That record is anOutput.mapthat throws for an Access-protected origin with nodevoverride, and Apply evaluates every binding before reconciling the host. OnlyLocalWorkerProviderreads it, so it is now contributed only when the host Worker runs locally (host.Mode ?? defaultProviderModeis"local"), the same resolution the planner uses and the same gatebindWorkerAsyncBindingsapplies to Access enrollment.alchemy devwith a local Worker keeps the existing error.Alchemy.remote()Worker in dev no longer needs adevorigin.Hyperdrive.test.tsdeploys a real Access-protected origin: Postgres in Docker behind a Cloudflare Tunnel (cloudflaredruns on the test machine), guarded by a self-hosted Access app admitting one service token. An Effect Worker (Hyperdrive.Connect) and an async Worker (env) both bind the Connection withoutdevand run a query through it. It is skipped whencloudflaredordockeris missing.