bun icon indicating copy to clipboard operation
bun copied to clipboard

Bun + Postgres > net.Socket undefined

Open danielsrod opened this issue 2 years ago • 3 comments

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

image

danielsrod avatar Dec 17 '22 16:12 danielsrod

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

ThatOneBro avatar Dec 17 '22 17:12 ThatOneBro

Thanks @ThatOneBro I will wait for new updates

danielsrod avatar Dec 17 '22 18:12 danielsrod

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

wenerme avatar Jan 12 '23 12:01 wenerme

knex + pg works in 0.8.1, but mikro orm not works

wenerme avatar Sep 07 '23 20:09 wenerme

Are you guys missing Long as well @ThatOneBro?

TypeError: Long.fromInt is not a function. (In 'Long.fromInt(1000)', 'Long.fromInt' is undefined)

jscul avatar Sep 09 '23 07:09 jscul

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 avatar Sep 21 '23 13:09 dereke

@dereke See #6121 + #5902

MelleB avatar Oct 04 '23 07:10 MelleB