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

JSONParseError: Unexpected token is not valid JSON when Authorizing an Org #3146

Open
kkorynta opened this issue Dec 11, 2024 · 1 comment
Open

Comments

@kkorynta
Copy link

Summary

Unable to authorize an org and unable to commit project changes to the org as a result.

Expected result

In VS Code, use CTRL+SHIFT+P > SFDX: Authorize an Org > Sandbox > orgName > (in browser) complete OAuth > authorization > VS Code linked to org

Actual result

The authorization process is not completing the callback to VS code.
2024-12-10_16-34-35

The output in VS code displays:
10:28:29.43 sf org:login:web --alias wizard --instance-url https://test.salesforce.com --set-default (node:12604) [DEP0040] DeprecationWarning: The punycodemodule is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ... to show where the warning was created) Error (1): Unexpected token '

Additional information

The punycode deprecation warning is also new.

I tried uninstalling node & sfdx CLI. I deleted any node/npm folders from %appdata%\local. Uninstalled & reinstalled the salesforce extension pack (expanded). Note - the Agentforce extension is also producing an unknown error.

I resolved a peer dependency with eslint by updating the project's package.json file for '@salesforce/sfdx-lwc-jest(v5.1.0) andeslint` (8.57.1) then running npm install.

System Information

CLI:
@salesforce/cli/2.68.6 win32-x64 node-v22.11.0

Plugin Version:
@oclif/plugin-autocomplete 3.2.10 (core)
@oclif/plugin-commands 4.1.10 (core)
@oclif/plugin-help 6.2.18 (core)
@oclif/plugin-not-found 3.2.28 (core)
@oclif/plugin-plugins 5.4.17 (core)
@oclif/plugin-search 1.2.16 (core)
@oclif/plugin-update 4.6.13 (core)
@oclif/plugin-version 2.2.16 (core)
@oclif/plugin-warn-if-update-available 3.1.23 (core)
@oclif/plugin-which 3.2.19 (core)
@salesforce/cli 2.68.6 (core)
apex 3.6.3 (core)
api 1.3.2 (core)
auth 3.6.75 (core)
data 3.11.4 (core)
deploy-retrieve 3.15.13 (core)
info 3.4.21 (core)
limits 3.3.40 (core)
marketplace 1.3.6 (core)
org 5.2.4 (core)
packaging 2.9.3 (core)
schema 3.3.42 (core)
settings 2.4.6 (core)
sobject 1.4.46 (core)
telemetry 3.6.23 (core)
templates 56.3.30 (core)
trust 3.7.43 (core)
user 3.6.3 (core)
SF ENV. VARS.
SF_AUTOUPDATE_DISABLE,true
SF_BINPATH,C:\Users\Kelly Shoemake\AppData\Local\sf\client\bin\sf
SF_DISABLE_AUTOUPDATE,true
SF_UPDATE_INSTRUCTIONS,Use "npm update --global @salesforce/cli" to update npm-based installations.
Windows: true
Shell: powershell
Channel: stable

Diagnostics

✅ pass - salesforcedx plugin isn’t installed
✅ pass - you don't have any linked plugins
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/
✅ pass - using latest or latest-rc CLI version
✅ pass - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion
✅ pass - can access: https://test.salesforce.com
✅ pass - can access: https://appexchange.salesforce.com/services/data
✅ pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
✅ pass - [@salesforce/plugin-auth] CLI supports v2 crypto
✅ pass - [@salesforce/plugin-auth] CLI using stable v1 crypto

@iowillhoit
Copy link
Contributor

Hey @kkorynta, could you please try a few things for me?

  • Update to the latest version of the CLI (currently 2.69.14). We just fixed that punycode warning (release notes)
  • What happens when you run this exact same login command on the command line? I am trying to determine if it is a VSCode issue or a CLI issue.
  • If this is still happening on just the command line, can you run that same login command with the --dev-debug flag and provide the output?

Thanks!

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

2 participants