node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

DeprecationWarning: using Buffer without 'new'

Open leroydev opened this issue 10 years ago • 9 comments

In Node.js v7.x (which is nowadays the 'current' Node.js branch), a DeprecationWarning is shown because of line 299 of connection.js.

Not a huge problem for now, but would be nice to get rid off I think. :)

Stacktrace:

DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
    at Buffer (buffer.js:79:13)
    at Object.<anonymous> (C:\project\node_modules\pg\lib\connection.js:299:19)

Edit: looks like this is already getting fixed by either #1156 or #1154, my bad!

leroydev avatar Oct 27 '16 20:10 leroydev

I appreciate the report - it should be fixed soon!

brianc avatar Oct 31 '16 15:10 brianc

Did this ever get fixed?

abduncan avatar Nov 26 '16 00:11 abduncan

Still happening to me. I'm using node 7.1.0.

Zabanaa avatar Nov 28 '16 08:11 Zabanaa

@abduncan Not yet, as far as I know. I don't know why this issue was closed.

leroydev avatar Nov 28 '16 12:11 leroydev

https://github.com/brianc/node-postgres/issues/1163

caycecollins avatar Nov 30 '16 02:11 caycecollins

Stil having issues with this...

unstephenk avatar Dec 16 '16 23:12 unstephenk

@Zabanaa @unstephenk Upgrade to Node ~~7.1.2~~ 7.2.1.

charmander avatar Dec 18 '16 03:12 charmander

@charmander I'm on 7.2.0

GastonRosso avatar Dec 26 '16 20:12 GastonRosso

@GastonRosso Sorry, that was a typo; upgrade to 7.2.1.

charmander avatar Dec 31 '16 23:12 charmander