Getting an "Only absolute URLs" error while trying to open Salesforce org with sfdx:open in VS Code

19.1k Views Asked by At

Warning: Deprecated environment variable: SFDX_JSON_TO_STDOUT. Please use SF_JSON_TO_STDOUT instead. (Use node --trace-warnings ... to show where the warning was created) Warning: The "force org open" command has been deprecated. Use "org open" instead. Error (1): Only absolute URLs are supported 14:52:35.666 sfdx force:org:open ended with exit code 1 While using sfdx:open default org in the VS code I am getting the above error please help me out of this?

Trying to open my default salesforce development org but failed to do so.

6

There are 6 best solutions below

0
Hector Moreno-Bravo On

Try to reauthorize the org. Use the following command on the terminal:

sfdx org:login:web --instance-url [your url]

do not add 'www' should just be https://yourdomain.salesforce.com

0
Amit On

I tried updating sfdx-project.json file and it worked: Old:

{
  "packageDirectories": [
    { 
    "path": "force-app"
    }
  ],
  "name": "SelfMainOrg",
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "57.0"
}

New:

{
  "packageDirectories": [
    { "path": "force-app", "default": true },
     
    { "path" : "manifest" }
  ],
  "name": "SelfMainOrg",
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "57.0"
}

In Summary I added path for Manifest. Technically as I was retrieving or deploying a Single file by selecting it and clicking on "Deploy Source to Org", adding Manifest path is irrelevant. But somehow it did work for me.

2
Mila Mirovic On

I did the same thing, just try this command:

sfdx org:login:web --instance-url [your url]

You can find the correct url by clicking on View Profile button (top right) as in the following figure:

enter image description here

0
vanessen On

None of those solution worked for me. I suspect that migration from enhanced domain caused the issue. To solve the issue, I log out from vs code using the following sfdx command :

sfdx auth:logout

Then after that , I reauthenticate to my org. Then after that I had to close my vs code and restart it. If I do not close my vs code , the error where persisting. After that, It worked well.

0
Plinderman On

Running the usual, "SFDX: Authorize an Org", command from the VsCode Command Palette, then closing and re-opening Vscode fixes this issue.

0
Jorge Valdés On

I recently installed sf and removed sfdx and I was having the same problem. Here is how I solved it:

Delete the alias that wasn't working with this command:

sf org logout --target-org [alias] --no-prompt

Then I authorized an Org but not with commands, that way it didn't work out for me, I had to do it with clicks:

  1. Ctrl + Shift + P
  2. SFDX: Authorize an Org
  3. Select Custom enter image description here
  4. Add the enhanced URL with this format: https://mycompany--dev.sandbox.my.salesforce.com enter image description here