Skip to content

Error: [DEP0005] DeprecationWarning: Buffer() is deprecated #3

@michaelhigham

Description

@michaelhigham

When CloudWatch triggers the lambda function, the following error occurs:

2022-07-26T15:01:37.913Z INFO connected to Logsene
2022-07-26T15:01:38.584Z ERROR (node:9) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Issue seems related to the latest version of the Node buffer module introducing a new API and the Buffer() function and new Buffer() constructor are deprecated:
https://www.npmjs.com/package/buffer

The safe-buffer module is a drop-in replacement for the buffer module and may resolve the issue:
https://www.npmjs.com/package/safe-buffer

Node.js documentation:
Porting to the Buffer.from() / Buffer.alloc() API

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions