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

Getting Cannot read properties of undefined (reading 'replace') error #9

Closed
geekyayush opened this issue Nov 16, 2023 · 4 comments
Closed
Labels
wontfix This will not be worked on

Comments

@geekyayush
Copy link

I am getting this error.
My setup is same as given in the readme example. I am using RDS proxy on AWS.

ERROR Uncaught Exception {"errorType":"TypeError","errorMessage":"Cannot read properties of undefined (reading 'replace')","stack":["TypeError: Cannot read properties of undefined (reading 'replace')"," at queryError (file:///var/task/packages/functions/src/my-lambda.mjs:807408:49)"," at errored (file:///var/task/packages/functions/src/my-lambda.mjs:807403:17)"," at Socket.error (file:///var/task/packages/functions/src/my-lambda.mjs:807395:5)"," at Socket.emit (node:events:517:28)"," at Socket.emit (node:domain:489:12)"," at emitErrorNT (node:internal/streams/destroy:151:8)"," at emitErrorCloseNT (node:internal/streams/destroy:116:3)"," at process.processTicksAndRejections (node:internal/process/task_queues:82:21)"]}

@igalklebanov
Copy link
Member

Hey 👋

What node runtime are you using in your lambda?
What versions of kysely, postgres, kysely-postgres-js are you using?
Can you share a non-bundled stack trace?

@geekyayush
Copy link
Author

What node runtime are you using in your lambda?
What versions of kysely, postgres, kysely-postgres-js are you using?
Can you share a non-bundled stack trace?

@igalklebanov

Node runtime: Node 18x
Versions:

"kysely": "^0.26.3",
postgres: 3.4.3
kysely-postgres-js: 2.0.0

Since I am using RDS proxy, I cannot connect from my localhost, and thus cannot generate the non-bundled stack trace.
I am using sst.dev framework for deployment.
My localhost postgres just work fine.

I also tried the postgres Dialact that comes in kysely. It's also having problem connecting to the RDS proxy.
That dialact is throwing the following error:
"Connection terminated unexpectedly".

and I found this github issue regarding same: brianc/node-postgres#2112

So I suspect it's something to do with the RDS proxy. but still, I could not find any solution.
If I remove RDS proxy and directly use RDS db, then it works fine.

If you faced something similar, and could help me, I would greatly appreciate. ^_^

@igalklebanov
Copy link
Member

igalklebanov commented Nov 16, 2023

SST projects are notorious for having multiple kysely versions installed. I suspect this is your issue. SST core uses kysely 0.25.x afaik. You could switch to pnpm/yarn or find a way to deduplicate your kysely dependency in node_modules.

This seems unrelated to this dialect.

@igalklebanov igalklebanov added the wontfix This will not be worked on label Nov 16, 2023
@geekyayush
Copy link
Author

SST projects are notorious for having multiple kysely versions installed. I suspect this is your issue. SST core uses kysely 0.25.x afaik. You could switch to pnpm/yarn or find a way to deduplicate your kysely dependency in node_modules.

Thanks for your reply. I will check that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants