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.

v5.2.9 breaks on Node 4.1 and 5.9 (+more) Buffore.alloc

See original GitHub issue

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Since 5.2.9 the mongo library (in current range) causes:

Uncaught TypeError: Buffer.alloc is not a function

If the current behavior is a bug, please provide the steps to reproduce.

Here is a test case that shows the error:

for 5.9 https://travis-ci.org/mblarsen/mongoose-hidden/jobs/417260776#L628 for 4.1 https://travis-ci.org/mblarsen/mongoose-hidden/jobs/417260777#L538

Note that just above you’ll see:

current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

I’m not sure that is related.

Please mention your node.js, mongoose and MongoDB version.

"mongoose": "^5.0.0",

No MongoDB depency since my code is a Mongoose library. The error occurs on Travis.

services: mongodb

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Fongercommented, Aug 20, 2018

They merged my 2 pull requests with this comment:

We are indeed deprecating node v4 in the upcoming months, but in the meantime should in fact be using this. Thanks for the contribution!

We need to wait until mongodb-core@3.1.3 and mongodb@3.1.4 are released

1reaction
Fongercommented, Aug 19, 2018

@mblarsen That’s because Buffer.alloc was actually added in 5.10 and back port to node.js 4.5. At that time, node.js 4.x was still under active development.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Porting to the Buffer.from() / Buffer.alloc() API - Node.js
--pending-deprecation will show more types of deprecation warnings. In particular, it will show the Buffer() deprecation warning, even on Node.js 8. You can...
Read more >
What's New | Oracle, Software. Hardware. Complete.
Oracle Linux with Oracle enterprise-class support is the best Linux operating system (OS) for your enterprise computing needs.
Read more >
Vulnerability Detection Pipeline - Qualys Community
Browse, filter by detection status, or search by CVE to get visibility into upcoming and new detections (QIDs) for all severities.
Read more >
libvirt releases
This release fixes a bug in setup of a migration with non-shared storage ( virsh migrate --copy-storage-all) which was broken by a refactor...
Read more >
The engine "node" is incompatible with this module
You can try to ignore the engines : $ yarn install --ignore-engines. OR. $ yarn global add <your app> --ignore-engines.
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