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

Error building VSCode extension when @azure/identity-vscode is installed #29812

Open
3 of 6 tasks
Power-Maverick opened this issue May 25, 2024 · 8 comments
Open
3 of 6 tasks
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@Power-Maverick
Copy link

  • Package Name: @azure/identity-vscode
  • Package Version: 1.0.0
  • Operating system: macOS & Win 11 both
  • nodejs
    • version: 21.7.2
  • browser
    • name/version: Chrome
  • typescript
    • version: 5.5.0
  • Is the bug related to documentation in

Describe the bug
When I am adding the npm package @azure/identity-vscode to my VS Code extension Dataverse DevTools that is built using webpack; I am getting compile errors on keytar package

To Reproduce
Steps to reproduce the behavior:

  1. Clone Dataverse DevTools and use the branch feat-enable-azure-login
  2. Run npm run compile

Expected behavior
The package installation should not throw error.

Screenshots
Error screenshot
image

Additional context
Error:

ERROR in ./node_modules/keytar/build/Release/keytar.node 1:0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
 @ ./node_modules/keytar/lib/keytar.js 1:13-52
 @ ./node_modules/@azure/identity-vscode/dist-esm/identity-vscode/src/index.js 3:0-28 35:60-82
 @ ./src/login/login.ts 41:26-59
 @ ./src/helpers/dataverseHelper.ts 39:16-41
 @ ./src/extension.ts 36:26-62
@github-actions github-actions bot added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 25, 2024
Copy link

@KarishmaGhiya @maorleger

Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@maorleger
Copy link
Member

Hey @Power-Maverick - thanks for reaching out about this issue! I think you need to configure a node-loader for this as per atom/node-keytar#59 (comment)

However, I should warn you that we unfortunately hit a blocking issue that may prevent @azure/identity-vscode from working correctly (see https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TROUBLESHOOTING.md#troubleshoot-visual-studio-code-authentication-issues for more information)

While we resolve this internally we recommend using the az cli if possible. Hope this helps.

@JLunda
Copy link

JLunda commented May 29, 2024

I am also running into this issue when building a Vite/TypeScript/React application. From my limited understanding of how Vite is using the Rollup bundler under-the-hood, I think this issue may be related to the node loader for module resolution; however Vite's official documentation recommends that the moduleResolution setting be set to bundler: https://vitejs.dev/guide/migration#:~:text=If%20you%20are%20using%20TypeScript%2C%20make%20sure%20to%20set%20moduleResolution%3A%20%27bundler%27%20(or%20node16/nodenext)%20as%20Rollup%204%20requires%20it.%20Or%20you%20can%20set%20skipLibCheck%3A%20true%20instead.

I will try the node16 and nodenext values eventually and report back if any of those fix things for me, but it may be a while before I get to attempt this as project deadlines currently dictate what I am able to spend time experimenting on, unfortunately.

@Power-Maverick
Copy link
Author

@maorleger do you have any anticipated date for the fix?

@maorleger
Copy link
Member

maorleger commented Jun 19, 2024

@Power-Maverick - unfortunately not at this time, as we have upstream dependencies that the VSCodeCredential relies on and need to be fixed first.

I would recommend subscribing to #22904 if you'd like to be notified of any updates or when an alternative solution is published.

cc @scottaddie

@maorleger
Copy link
Member

Linking to the many threads on this:

microsoft/vscode-azure-account#443

  • VSCodeCredential uses the Azure Account extension for authentication retrieval. 0.10.0 of the Azure Account Extension introduced a breaking change causing VSCodeCredential to no longer work

#22904

  • The issue tracking aligning all our upstream dependencies (VSCode, Azure Account Extension, etc) to provide a new mechanism for authentication

@maorleger do you have any anticipated date for the fix?

Just to clarify, do you mean the fix to your original issue? There's no fix that needs to happen on the Azure SDK side, you likely need to add a node loader as per atom/node-keytar#59 (comment)

@KarishmaGhiya
Copy link
Contributor

Hello folks, please don't use VisualStudioCredential, please use AzureCliCredential instead until we actually have a path forward, until there's a resolution on this - #22904. This likely won't happen in the near future, since there are multiple teams involved in the effort. Look at the note on the Readme - https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/README.md#note-about-visualstudiocodecredential
The current state of VisualStudioCredential is broken, and we have removed it from our DAC chain.
cc: @Power-Maverick @JLunda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Untriaged
Development

No branches or pull requests

4 participants