Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer deprecated warning #114

Closed
sandy081 opened this issue Dec 9, 2019 · 3 comments
Closed

Buffer deprecated warning #114

sandy081 opened this issue Dec 9, 2019 · 3 comments

Comments

@sandy081
Copy link

sandy081 commented Dec 9, 2019

I am developer from VS Code and we are using this module yauzl v2.9.2 and it throws following warning.

(node:336) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

This warning is coming from its dependency fd-slicer

internal/process/warning.js:127
      throw warning;
      ^

DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    at showFlaggedDeprecation (buffer.js:156:11)
    at new Buffer (buffer.js:171:3)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/fd-slicer/index.js:109:18
    at pendGo (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/pend/index.js:54:3)
    at onCb (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/pend/index.js:41:7)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/fd-slicer/index.js:31:7
    at FSReqCallback.wrapper [as oncomplete] (fs.js:477:5) {
  name: 'DeprecationWarning',
  code: 'DEP0005'
}

Filed issue against fd-slicer module - andrewrk/node-fd-slicer#3

Ref: microsoft/vscode#82524

@nalhabash
Copy link

@sandy081 @thejoshwolfe this issue is still happening for me when i deploy my project using yauzl.
It's because of the fd-slicer dependency using a deprecated constructor.
My PR there fixes the issue: #115

@hwlmatt
Copy link

hwlmatt commented Oct 2, 2020

@nalhabash thank you for this fix!

For anyone else, I implemented this temporarily (hoping @nalhabash's will be merged in) by forking yauzl and aliasing the broken fd-slicer to nalhabash's fd-slicer2 package instead.
Allowed me to proceed without having to make any changes to the actual yauzl codebase.

in package.json this reads as:
"dependencies": { "fd-slicer": "npm:fd-slicer2",

To make the change in your own fork:
remove the old one:
npm uninstall fd-slicer
alias with new one:
npm install fd-slicer@npm:fd-slicer2

Thanks again to @nalhabash

@thejoshwolfe
Copy link
Owner

Thanks yall for your patience. I have finally found the enthusiasm to address this issue. Fixed in yauzl 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants