mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #1044] hyperdrive not working #229
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#229
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xucongyong on GitHub (May 4, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/1044
https://hyperdrive-test-dbt.pages.dev/api/test-hyperdrive
error: {"success":false,"error":"Uncaught TypeError: Failed to establish the WebSocket connection: expected server to reply with HTTP status code 101 (switching protocols), but received 530 instead."}
I can connect to the database normally, but I can't connect via Hyperdrive. How should I fix this?
code:
import { Client } from "pg";
export default {
async fetch(request, env, ctx) {
// Hyperdrive provides a unique generated connection string to connect to
// your database via Hyperdrive that can be used with your existing tools
const client = new Client({ connectionString: env.HYPERDRIVE.connectionString });
await client.connect();
},
}
@james-elicx commented on GitHub (May 5, 2026):
Please can you share a repository that reproduces the issue?
I deployed a project last week that uses Planetscale Postgres via Hyperdrive and have not run into this problem.