Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Deprecation warning during command line installation of VS Code Q# extension #1130

Open
ricardo-espinoza opened this issue Sep 2, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ricardo-espinoza
Copy link
Contributor

ricardo-espinoza commented Sep 2, 2021

When the Visual Studio Code extension is installed using the command line, the following warning is shown:

PS > code --install-extension .\quantum-devkit-vscode-0.18.2108160999.vsix
Installing extensions...
(node:33076) [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)
Extension 'quantum-devkit-vscode-0.18.2108160999.vsix' was successfully installed.
(node:33076) UnhandledPromiseRejectionWarning: Canceled: Canceled
    at D (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:5:1157)
    at O.cancel (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:9:62880)
    at O.dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:9:63012)
    at N.dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:9:63274)
    at d (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:3655)
    at N.clear (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:4133)
    at N.dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:4112)
    at dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:4672)
    at dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:11:7330)
    at d (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:3655)
    at AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:3843
    at AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:3942
    at Object.dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:762)
    at d (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:3788)
    at AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:14:41520
    at Map.forEach (<anonymous>)
    at Ne.dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:14:41496)
    at d (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:3655)
    at N.clear (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:4133)
    at N.dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:4112)
    at S.dispose (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:6:4672)
    at Object.M [as main] (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:17:38649)
    at async N (AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:12:13842)
(node:33076) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:33076) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This warning does not prevent the installation to succeed, and the extension can be used normally after that. It is also possible to install the extension using the UI in VS Code without seeing any warnings.

This is still present in version 0.18.2108.160999 of the QDK.

@ricardo-espinoza ricardo-espinoza added bug Something isn't working needs triage An initial review by a maintainer is needed labels Sep 2, 2021
@ricardo-espinoza ricardo-espinoza self-assigned this Sep 2, 2021
@bettinaheim bettinaheim removed the needs triage An initial review by a maintainer is needed label Sep 3, 2021
@warren-jones
Copy link
Contributor

warren-jones commented Sep 9, 2021

The “DeprecationWarning: Buffer() is deprecated…” warning is also mentioned in these VS Code Issues:
microsoft/vscode#123180
microsoft/vscode#127182
microsoft/vscode#74438
microsoft/vscode#65088
microsoft/vscode#67534
microsoft/vscode#68044
microsoft/vscode#68159

I created a minimal “Hello World” VS Code extension, per Your First Extension, then made these changes to eliminate warnings and errors reported by vsce:

  • Added a publisher name in package.json as Line 6: "publisher": "v-wjones",
  • Added a repository name in package.json as Line 7: "repository": "C:/Users/v-wjones/OneDrive - Microsoft/Documents/experimentalextension",
  • Deleted all but the first line of README.md

I then packaged the extension to a vsix file using vsce:

PS C:\Users\v-wjones\OneDrive - Microsoft\Documents\experimentalextension> vsce package
Executing prepublish script 'npm run vscode:prepublish'...

> [email protected] vscode:prepublish
> npm run compile

> [email protected] compile
> tsc -p ./

DONE  Packaged: C:\Users\v-wjones\OneDrive - Microsoft\Documents\experimentalextension\experimentalextension-
0.0.1.vsix (6 files, 2.94KB)

Finally, I installed the extension using a VS Code Terminal window, and got the same warning:

PS C:\Users\v-wjones\OneDrive - Microsoft\Documents\experimentalextension> code --install-extension
.\experimentalextension-0.0.1.vsix
Installing extensions...
(node:8732) [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)
Extension 'experimentalextension-0.0.1.vsix' was successfully installed.

Based on this evidence, I believe this issue is not a bug in the quantum-devkit-vscode extension. Should we pass this back to the vscode team?

@ricardo-espinoza
Copy link
Contributor Author

Agreed. Contacting the VS Code team for feedback.

@munishgoyal1
Copy link
Member

Tagging Isidor - PM on the VS Code team to take it forward. @isidorn

@isidorn
Copy link

isidorn commented Sep 14, 2021

I have commented on the vscode issue, let's continue the discussion there microsoft/vscode#133062
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants