bun
bun copied to clipboard
Bun + Postgres > net.Socket undefined
What version of Bun is running?
0.3.0
What platform is your computer?
Linux 6.0.12-1217.native x86_64
What steps can reproduce the bug?
Running application and execute a query
What is the expected behavior?
the query result
What do you see instead?
TypeError: undefined is not a constructor (evaluating 'new net.Socket')
inside package, I run a console.log and return undefined from net.Socket
Additional information
Hi @danielsrod,
You're receiving this error because Bun is currently missing the net
module polyfill. It is one of the higher priority polyfills on our to-do list, but as of now it's still not available. Currently dns
is in the works and net
may follow that one
One of the things we should probably do is make an up-to-date list of all the missing node builtins we haven't gotten to yet. Sorry about the inconvenience
Thanks @ThatOneBro I will wait for new updates
Canary has dns now, but still not works
import Knex from "knex";
const knex = Knex({
client: "pg",
connection: "postgres://"
});
const { rows } = await knex.raw("select 1 as n");
console.log(rows);
error: invalid startup packet layout: expected terminator as last byte
code: "08P01"
NodeJS works , but bun failed
knex + pg works in 0.8.1, but mikro orm not works
Are you guys missing Long as well @ThatOneBro?
TypeError: Long.fromInt is not a function. (In 'Long.fromInt(1000)', 'Long.fromInt' is undefined)
knex + pg works in 0.8.1, but mikro orm not works
I can connect and execute queries but after I do that the process just sort of hangs and never exits - this is using the example code above ^
@dereke See #6121 + #5902