70 Replies
Project ID:
6702f829-1168-47a1-a335-c0167d00dc21
6702f829-1168-47a1-a335-c0167d00dc21
nodejs right?
attempting to connect to PostgreSQL server on my local host server causes this to happen
yes it's nodejs
what package are you using to connect?
ts-postgres
can you show me the
new Client()
code?and how are those variables getting set?
what do you mean
like with an .env file or through railway run
.env file
are you loading the .env file
if i console.log those variables, they're there
exactly correctly
remove keepalive?
i don't know i console.log the process.env variables, they're there
with or without it doesn't work
same error
do you have
client.end()
anywhereyes
doesn't affect anything
youve tried removing it?
it just stops if i have line 11
it shits itself when i have client.connect()
if i remove it it works perfectly fine
well if you remove the connect its not gonna connect lol
...yeah
have you tried a different package?
no
i don't want to use other packages
just as a little test
maybe railway is saying "FUCK YOU" to my connection attempts
have you tried with dbgate?
no
can you please?
i know it's this
fuck thsi im using redis
i don't know anymore
it's been 4 hours
ts-postgres just might be incompatible with the version of postgres railway runs
i haven't made any feature yet
just try connecting with dbgate please
fine im gonna download dbgate
thanks 🙂
what now
connection worked?
obviously
what now
use a different postgres client package
ew javascript
im sure there are many ts clients
no
only one
well the "only one" doesnt seem to work
congrats
ah the joys of js/ts development
You probably don't want to use that package anyway. The popular option is
pg
not postgres
Try npm install --save pg @types/pg
oh yeah fad is right
pg
is the way to goyippee
ayy thats awsome, thanks fad!
where is the docs
im blind
yippee
pain
part of docs too !!!
bullshit
I think you're importing the class the wrong way
the wrong way?
You don't have to type the full path to the module. Just type the module name.
Oh nevermind then
im going back to postgres
this is just ridiculous
It seems really weird that the error message shows the full path to the module.
im just gonna mute this error
no quick fixes available
its finished
Honestly from my point of view your issue is more of a transpiler config issue.
done
im off to finish my very useful website
that i didn't just waste 3 hours trying to fix something so ridiculous as this