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

(node:20120) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues #123180

Closed
kanlukasz opened this issue May 6, 2021 · 7 comments

Comments

@kanlukasz
Copy link

Version: 1.56.0
Commit: cfa2e218100323074ac1948c885448fdf4de2a7f
Date: 2021-05-04T22:09:06.405Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.19042

Steps to Reproduce:

  1. Open VSCode

  2. Open Toggle Dev Tools

[Extension Host] (node:6096) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.(Use `Code --trace-deprecation ...` to show where the warning was created) 
S @ console.ts:137
_logExtensionHostMessage @ localProcessExtensionHost.ts:514
(anonymous) @ localProcessExtensionHost.ts:282
emit @ events.js:315
emit @ internal/child_process.js:903
processTicksAndRejections @ internal/process/task_queues.js:81

screenshot version:
obraz

Does this issue occur when all extensions are disabled?: Yes

@isidorn isidorn removed their assignment May 6, 2021
@JacksonKearl
Copy link
Contributor

This does not appear to be a bug as much as an internal warning message.

@pedro-w
Copy link

pedro-w commented May 10, 2021

@JacksonKearl I have also seen this when running vscode-test on an extension I'm developing. Are you saying for sure this is coming from VSCode itself? If so, I don't need to worry - otherwise if it's in my extension I need to find out how to pass that --trace-deprecation flag so I can track it down. Thanks!

@JacksonKearl
Copy link
Contributor

@pedro-w you can try starting an empty extension to verify the source, I can't say for sure that it's VS Code in your case.

@kanlukasz
Copy link
Author

This warning is from VSCode. Just run a clean and fresh portable instance to check it out

@supperchong
Copy link

supperchong commented May 21, 2021

@JacksonKearl The reason is that VSCode has dependency vscode-proxy-agent-> get-uri->ftp. https://github.com/microsoft/vscode/blob/main/yarn.lock
The ftp is too old, it use new buffer() in this line .Maybe it's better to change to other Module.
In addition,I add the code in bootstrap-fork.js to find out the warning position .

process.on('warning', (warning) => {
    console.log(warning.stack);
});

@pedro-w
Copy link

pedro-w commented May 21, 2021

Note there is already an issue filed on ftp for this: mscdex/node-ftp#255 and a PR to fix it.

@supperchong
Copy link

@pedro-w yeah, but it hasn't been merged yet.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants