forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

Can't Authorize an Org: "Named export 'prompts' not found." #5919

Open JasonL-HealthTrust opened 1 day ago

JasonL-HealthTrust commented 1 day ago

Summary

Due to my Windows user profile being wiped, I had to reinstall the Salesforce Extension Pack on my VS Code and reconfigure it. I installed Salesforce Extension Pack (Extended) v62.2.0. I was able to create a new project with manifest, but when I use the Authorize an Org command, I get the following error:

Starting SFDX: Authorize an Org

10:01:17.727 sf org:login:web --alias DEV --instance-url https://test.salesforce.com --set-default SyntaxError: Named export 'prompts' not found. The requested module '@salesforce/sf-plugins-core' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@salesforce/sf-plugins-core';
const { prompts, StandardColors } = pkg;

10:01:19.567 sf org:login:web --alias DEV --instance-url https://test.salesforce.com --set-default ended with exit code 1

I have tried to uninstall the extension pack, restart VS Code, and reinstall it, but that results in the same error.

Salesforce Extension Version in VS Code: v62.2.0

Salesforce CLI Version: 2.63.7 win32-x64 node-v20.17.0

OS and version: Windows 11

VS Code version: 1.94.2 (system setup)

Java version: JAVA_RUNTIME_VERSION="21.0.5+9-LTS-239" JAVA_VERSION="21.0.5" JAVA_VERSION_DATE="2024-10-15"

Most recent version of the extensions where this was working: It is working for a coworker on v62.2.0, the same version I am using

svc-idee-bot commented 1 day ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

svc-idee-bot commented 1 day ago

Hello @JasonL-HealthTrust :wave: It looks like you didn't provide all the required basic info in your issue.

If you haven't already, please provide the following info: Salesforce Extension Version in VS Code: Salesforce CLI Version: OS and version: VS Code version: Most recent version of the extensions where this was working:

Here's an example of a set of required info that will pass the validation: Salesforce Extension Version in VS Code: 60.13.0 Salesforce CLI Version: @salesforce/cli/2.42.6 darwin-arm64 node-v18.18.2 OS and version: MacOS Sonoma 14.5 VS Code version: 1.89.1 Most recent version of the extensions where this was working: 60.11.0

A few more things to check:

Thank you!

mingxuanzhangsfdx commented 1 day ago

Hi @JasonL-HealthTrust , could you please try to use the sf cli directly in the VSCode terminal instead of the VSCode command?

If it does not work either, you can reach out to forcedotcom/cli.

Let me know the result. Thanks!