question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DeprecationWarning: using Buffer without 'new'

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
charmandercommented, Dec 31, 2016

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

1reaction
brianccommented, Oct 31, 2016

I appreciate the report - it should be fixed soon!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing "Buffer without new" deprecation warnings - gists · GitHub
If you're using Node.js, you might run into a warning like this: DeprecationWarning: Using Buffer without `new` will soon stop working.
Read more >
Using Buffer without `new` will soon stop working - Stack ...
(node:23488) DeprecationWarning: Using Buffer without new will soon stop working. Use new Buffer() , or preferably Buffer.from() , Buffer.
Read more >
Porting to the Buffer.from() / Buffer.alloc() API - Node.js
This guide explains how to migrate to safe Buffer constructor methods. The migration fixes the following deprecation warning: The Buffer() and new Buffer() ......
Read more >
DeprecationWarning: Using Buffer without `new` - NodeBB
DeprecationWarning : Using Buffer without new will soon stop working. Use new Buffer() , or preferably Buffer.from() , Buffer.
Read more >
Getting (node:3524) [DEP0005] DeprecationWarning: Buffer ...
(node:3524) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found