-
Notifications
You must be signed in to change notification settings - Fork 78
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
Comments
Hey @kkorynta, could you please try a few things for me?
Thanks! |
Hi @iowillhoit, I'm on a tight deadline to get a few projects hammered out, so I managed to fix this last week, the day after I logged this (12/12). I did try a few of those steps above: 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. I got the same error if it was a direct command or through the command palette. I did not capture a debug, but if I see another issue again in the future I'll grab that. As far as what I did to fix it
I should note, I had tried most of this before I logged the ticket, but I missed the residual folders for sf cli. I also did not mess with my environment variables and I did not create a fresh project from scratch. The first pass also did not resolve punycode, but I believe punycode was mostly a warning. If I had to guess, the removal of the sf residual folders with a cli uninstall was the fix. |
Hey @kkorynta, I really appreciate that you took the time to respond! Hopefully it will help someone else in the future 🏆 Based on what you shared, I would guess your assumption is correct. Removing the sf-related directories probably cleaned up some corrupt auth config. For future reference, we have all of the If you come across this again, feel free to open a new issue. Thanks again |
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.
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. (Use
node --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) and
eslint` (8.57.1) then running npm install.System Information
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
The text was updated successfully, but these errors were encountered: