Hello, I cannot deploy my next js app (
Hello, I cannot deploy my next js app (with the opennext adapter) with the hyperdrive binding. It keeps showing this error :
"UserError: 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_NEON' variable or "NEON"'s "localConnectionString" to the Postgres connection string."
- It's working with pnpm dev (and I understand why I would need to add this)
- But it's not working when trying to simply deploy this to our worker through our CI. And I don't understand why I would need to setup local connection string during a deployment 🤔
Thanks for your help !
5 Replies
Hey antoine, what command are you using for CI?
Hey Adrian, actually the step fails during the build with the command opennextjs-cloudflare build
Ok yeah this seems like a bug specific in our opennextjs-cloudflare library. I see you already opened an issue on github let me see if theres anyone that can action on it as I personally do not contribute to this project
Hey @Adrian , any news on this ? Thanks 🙂
Hey antoine, there is a potential workaround at the moment to use hyperdrive remote binding for the build command, https://opennext.js.org/cloudflare/bindings#remote-bindings
It seems like the opennextjs-cloudflare build command is calling on some wrangler api functions during the build step that fails unexpectedly for hyperdrive as you have seen. We're still spending some time investigating the issue but hopefully this workaround can get your CI builds unblocked
Edit: hyperdrive remote binding is actually not supported right now 😕 https://developers.cloudflare.com/workers/development-testing/#unsupported-remote-bindings
Bindings - OpenNext
Open-source Next.js adapters