What's the recommended way to build a

What's the recommended way to build a site with Pages using Hyperdrive? Every time I build (whether it's locally or on CF), I get this error:
Error: When developing locally, you should use a local Postgres connection string to emulate Hyperdrive functionality. Please setup Postgres locally and set the value of the 'WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE' variable or "HYPERDRIVE"'s "localConnectionString" to the Postgres connection string.
Error: When developing locally, you should use a local Postgres connection string to emulate Hyperdrive functionality. Please setup Postgres locally and set the value of the 'WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE' variable or "HYPERDRIVE"'s "localConnectionString" to the Postgres connection string.
For my local env, I did add that variable and it worked. However, I don't know what to do when using automated deploys from Github. I don't want to add this to the Cloudflare env (if I add it, it does work to fix the error) because I don't want it to overwrite Hyperdrive actually working properly. How do I build a pages site with Hyperdrive on Cloudflare? Build log for reference: db4f9c3e-eba7-4acd-ae2c-3f8835bf48ae
3 Replies
benank
benankOP7mo ago
Update: I got this to work. I needed a WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE env var everywhere I build, and it needs to be a valid db connection string (not sure if it actually needs to connect, but I just passed it my dev db connection string). After building, it will only use the actual hyperdrive binding and won't use the local connection string. Not a great experience and makes me a bit worried that I might connect to the wrong db, but it works.
elithrar
elithrar7mo ago
cc @thomasgauvin
Producer & Director Izumi Sakai
Cloudflare ゼロトラストヘルプ 安全を確認してください ファイアーウォールポリシー設定Workspage R2 SSL/TSL 証明書 1.1.1.1 WARP クライアント Cloudflare Zero Trust Agent One Downloadしてください
Want results from more Discord servers?
Add your server