Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsProxy config doesnt work anymore in 0.10.4 #133

Open
marcodejongh opened this issue Dec 15, 2024 · 3 comments
Open

wsProxy config doesnt work anymore in 0.10.4 #133

marcodejongh opened this issue Dec 15, 2024 · 3 comments

Comments

@marcodejongh
Copy link

marcodejongh commented Dec 15, 2024

Steps to reproduce

Setup nextjs up using the websocket proxy & docker approach outlined on: https://vercel.com/docs/storage/vercel-postgres/local-development
Using @neondatabase/[email protected]

Expected result

wsProxy callback is executed, which allows next.js app to connect

Actual result

wsProxy is never executed and all queries fail.

I put a debugger in the wsProxy callback but it was never reached in 0.10.4

Downgraded back to 0.9.5 fixes the problem, havent tried previous versions yet

Environment

Logs, links

@jawj
Copy link
Collaborator

jawj commented Dec 16, 2024

Thanks. I'll take a look.

@pantharshit007
Copy link

hey, @marcodejongh do you think this error Error: All attempts to open a WebSocket to connect to the database failed. Please refer to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined. Details: fetch failed

is somehow related to what you are experiencing I am using "^0.9.5" version of @neondatabase/serverless

@jawj
Copy link
Collaborator

jawj commented Jan 15, 2025

Sorry for the delay. I don't seem to be able to reproduce the problem. Try this:

git clone https://github.com/jawj/wsproxy-issue-133.git
cd wsproxy-issue-133
npm install
docker compose up -d
node index.mjs

For me, this produces the expected result:

Result {
  command: 'SELECT',
  rowCount: 1,
  oid: null,
  rows: [ { now: 2025-01-15T12:10:22.325Z } ],
  ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants