Questions tagged [vs-code]

Visual Studio Code is a free source code editor developed by Microsoft for Windows, Linux and macOS. When the "Salesforce Extensions for VS Code" are added it: supports syntax highlighting and intelligent code completion for Apex, Visualforce and Lightning Components; works well with SFDX including with scratch orgs; supports debugging. Git UI is built in. Many other extensions are available.

Filter by
Sorted by
Tagged with
2
votes
1answer
243 views

Visual Studio Code Prettier plugin for Apex not formatting VisualForce [closed]

I've been using VSC for ages now and have had the apex Prettier plugin installed and working, but it is no longer formatting my Visualforce pages (it's still doing it for apex classes). I now get this ...
2
votes
0answers
84 views

SFDX:Diff File Against Org command not working only for Apex Classes

In my VS Code, when I right-click on an Apex class I can't see 'SFDX:Diff File Against Org' command. But this is perfectly working for Aura components or Visualforce Pages. The problem only exists ...
0
votes
0answers
159 views

SFDX: Retrieve This Source from Org Not Deploy Metadata

I am using VS Code and did the below steps: Ran the command 'SFDX: Create Project with Manifest'. Ran the command 'SFDX: Authorize an Org' and authorized the org. Right-clicked the package.xml file ...
1
vote
1answer
45 views

Visual Studio Code Apex Replay Debugger Unsupported Java Error

I'm trying to use the Apex Replay Debugger on VSCode on an Apple MacPro (Big Sur) but get a 'Unsupported Java version'error. I have followed all the instructions https://developer.salesforce.com/...
1
vote
1answer
311 views

'SFDX: Retrieve Source in Mainfest from Org' not retrieving the components

In VS Code, I performed these steps: Ran the command 'SFDX: Create Project with Manifest'. Ran the command 'SFDX: Authorize an Org' and authorized the org. Right-clicked the package.xml file and ...
0
votes
1answer
16 views

What values to put into npm init when following workaround instructions to get eslint working in sfdx project?

I'm experiencing the same problem as the poser of this question: Why is ESLint not working properly for Lightning Web Components in VS Code and how to make it work? One of the steps is to run npm init ...
1
vote
1answer
56 views

Can't connect cloned repo to sandbox in VS Code

I'm using VS Code, Bitbucket, and a standard sandbox (not scratch org).  What's the correct procedure to clone an existing repository and connect it to the sandbox? I've read this question/answer but ...
0
votes
0answers
82 views

Error: INVALID_SESSION_ID: Session expired or invalid

I have an error when I try to uploud the code from VSCode in Salesforce organization. The error is this : Error: INVALID_SESSION_ID: Session expired or invalid I have a lightning web component and I ...
2
votes
0answers
30 views

sfdx force:org:list hangs

When I run the following command in either the VS Code terminal window, or a Windows Command Prompt, it returns all of the orgs, but hangs: sfdx force:org:list Is there some other way I should be ...
3
votes
1answer
286 views

How do I best switch versions of sfdx and plugins?

When there are bugs in different versions of SFDX CLI and the Plugins: There is a need to switch to another version. But I find uninstalling and re-installing too time consuming. Often people post ...
2
votes
1answer
28 views

How to Re-Enable VS Code Errors

I'm experiencing a strange phenomenon in which errors (I believe compile errors) are no longer being picked up by the VS Code SFDX code. Normally when I run "SFDX: Deploy this source to org",...
1
vote
2answers
124 views

Component not found in org after deployment from vs code

I am facing this weird issue where after I deploy my component/class from VS Code to org, it gets successfully deployed but when I am trying to find the same component/class in my org. I cant seem to ...
0
votes
1answer
75 views

The ApexClass name was not found in the workspace VSCode

Today I started to work on apex test class file after retrieve the source from the Sandbox I realized that the name of file is wrong I deleted the file test and the -meta.xml but when I retrieve again ...
0
votes
1answer
93 views

Why are my recordtypes not being updated, they are going into the wrong folder

I have a CLI situation whereby the recordtypes I make changes too are not being updated on a retrieve. I cannot find flaws in my process, I change the connected org correctly my XML has the fields, ...
1
vote
0answers
29 views

VS Code auto submit changes doesn't work for 1 file

The .js file for a lightning web component won't deploy to my org when I save the file in VS Code, but deploys fine if I right click in the file explorer and select Deploy Source to Org. The output ...
0
votes
0answers
88 views

Salesforce VS Code Issue

We are facing issue on my VS code every time its shows me The terminal process failed to launch: A native exception occurred during launch (Unable to start terminal process: CreateProcess failed). 2....
1
vote
1answer
39 views

VSCodedx is no longer showing execute anonumous debug logs in the output panel

All of a sudden my vscode isn't showing the debug logs from execute anonymous in the output panel. Other messages show up in there such as when I deploy a source to org, Turn on apex debug log for the ...
0
votes
0answers
21 views

Cant able to redirect dev hub( salesforce login) through vs code

When i try to open dev hub through Vs code in terminal. It redirects to login salesforce. After loggin saying that "the service and account specified in key.json do not match the version of the ...
0
votes
1answer
48 views

Visual Studio Code + WSL2 + Salesforce Extension Pack. Intellisense/code completion for Apex not working?

After the long break I currently back to Salesforce ecosystem and I'm trying to setup my development environment - Visual Studio Code with DX features (Salesforce CLI, Scratch Orgs etc.) and Windows ...
0
votes
0answers
20 views

Renamed components in Scratch Org and trying to retrieve them

I have created a custom object Named ExampleObject__c and Fields as "Field1__c", "Field2__c", "Field3__c" in my scratch org. and pulled this source from scratch org to ...
0
votes
0answers
49 views

Visual Studio Code, SFDXError with retrieve for Aura and LWC

since yesterday I started having an issue when I try to use the command SFDX:retrieve source from Org on Aura or LWC items. The command fails and I receive this error message: Also, I noticed that If ...
0
votes
0answers
28 views

Scratch Org Create Succeeded after timeout now how do I register org in my vscode from ScratchOrgInfo

So I issued a command to create a scratch org (based on a shape) and it took a long time to execute. In fact, it timed out. However the error code gave me the ID of my org to query for, e.g.: sfdx ...
1
vote
2answers
156 views

Make a copy of production org into another(mainly meta data)

Problem: To make an exact copy of the production org into another fresh production instance. Possible Solutions: I have thought of a few possible solutions, please let me know if there is any better ...
0
votes
1answer
35 views

Truncated logs in VSC, not showing all classes and uncovered lines

I don't know what has changed in the sfdx CLI but for some reason it now prints truncated logs in VSC + it shows a false message that the test ran successfully but they failed. To reproduce it, I open ...
0
votes
0answers
21 views

Make debugger stop on exception

I work in Visual Studio Code with Replay Debugger. Is there a way to make Replay Debugger stop on "exception"? Otherwise it is very confusing and difficult to figure out if exception ...
1
vote
1answer
29 views

How to delete saved orged configurations in vs code

How can I delete the org configurations which are saved. They always appear when I try to authorize any org and want to remove some of them. Thanks
6
votes
1answer
175 views

VS Code extension no longer including line number in Apex test failure output

When I run Apex tests from VS Code (leveraging Salesforce CLI), I'm accustomed to the output telling me what line my tests failed on in the event of failure. I've noticed a recent change (just in the ...
1
vote
1answer
399 views

How do I retrieve all files in VS Code?

I'm working on the Apex Specialist super badge on the Salesforce Trailhead. I'm also trying to get more comfortable with Visual Studio Code with the Salesforce extensions. I've successfully create a ...
1
vote
1answer
444 views

Unable to Run Tests from VSCode

Recently, I have been unable to run tests from VSCode, using the 'Run Test' or 'Run All Tests' links that display inline. I can still run the tests in the Salesforce Developer Console, just not from ...
2
votes
1answer
2k views

VSCODE: Unable to Authorize to an ORG

I'm having the same problem. For me, I'm not getting redirected to my salesforce Org. This is what I see in VSCode 12:22:15.474 sfdx force:auth:web:login --setalias DevOrg --instanceurl https://login....
1
vote
0answers
230 views

Not able to Authorize an Org with VS CODE

Steps to reproduce: Run the following command in terminal: sfdx force:auth:web:login --setalias org1 --instanceurl https://login.salesforce.com --setdefaultusername Then I am redirected to my ...
0
votes
0answers
54 views

Empty lines after each line in LWC meta files

After sfdx force:source:retrieve -x manifest/package.xml my meta files (only LWC) have empty empty lines after each line. Before retrieve: <LightningComponentBundle xmlns="http://soap.sforce....
3
votes
3answers
451 views

How do you run a test suite from Visual Studio Code?

How do you execute and get the results for a test suite from Visual Studio Code? Currently, whenever I want to run one, I have to go into the org, and then log into the developer console. It works, ...
1
vote
1answer
668 views

Fix the following lines in your .forceignore and add '# .forceignore v2' to your .forceignore file to switch to the new behavior

I have the following .forceignore file: # List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status # More information: https://...
0
votes
1answer
87 views

ApexPages.currentPage().getParameters() Method does not exist or incorrect signature

I use VS Code with Salesforce Extension Pack. I have this line in my class code: string cId = ApexPages.currentPage().getParameters().get('cId'); It gets a squiggle line under getParameters() and a ...
0
votes
0answers
39 views

Errors in standard object definitions

I use VS Code with Salesforce Extension Pack. I have created SFDX project with manifest; authorized my sandbox org; then refreshed sobject definitions (tools-sobjects-standardObjects). This gives me ...
1
vote
1answer
172 views

Getting SPAWN EPERM on running Authorize and Open Default Org commands

I am getting SPAWN EPERM error while running the sfdx authorize and open default org commands from both vs code and command line.
0
votes
0answers
272 views

ERROR running force:auth:web:login: spawn UNKNOWN

I am getting "ERROR running force:auth:web:login: spawn UNKNOWN" on Windows 10 when trying to authorize sandbox org from VS Code. I have already tried changing default browsers and have ...
0
votes
0answers
347 views

Deployment to Production org through VS code [duplicate]

I am trying to deploy the components to production org through VS code. I am getting the below error "sf:INVALID_OPERATION: INVALID_OPERATION: testLevel of NoTestRun cannot be used in production ...
1
vote
0answers
78 views

auto completion of slds classes is not working on Aura and LWC

Auto-suggestion of SLDS classes is not working in Aura and LWC after adding SLDS validator extension in VS Code. Please help me.
0
votes
1answer
646 views

component.css-meta.xml File in LWC getting created when retrieved through VS Code

Due to some recent updates to Salesforce DX or VS Code, I am getting an extra meta.xml file for each Lightning web component which I am trying to retrieve from the source. For example, if my component ...
0
votes
1answer
153 views

Getting an Error in Trailhead Analyze Your Code and Deploy It to Your Org in MyFirstWebComponent -

Getting an Error in Trailhead Analyze Your Code and Deploy It to Your Org in MyFirstWebComponent While I'm able to create all the components in Visual Code and push them to the Salesforce Trailhead ...
0
votes
1answer
142 views

Is it possible to fetch Approval process meta data using VS Code?

I am trying to fetch approval process metadata from one of my development org and deploy it to another development org, but I could not find a way to fetch the metadata regarding the approval process. ...
0
votes
1answer
180 views

In VS Code, why does 'SFDX: Update Checkpoints in Org' fail with 'Checkpoints can be set on valid line of Apex source. Invalid checkpoint location'

When running SFDX: Update Checkpoints in Org using Salesforce Extensions for Visual Studio Code I get the error Checkpoints can be set on valid line of Apex source. Invalid checkpoint location Why?
0
votes
0answers
21 views

Apex Replay Debugger SOQL

Ok so I am using the APEX Replay Debugger to debug my code. If I hover over the soQuote it doesnt display anything. IN the Debug Console it will show the debug statement. Is there a way to fix this so ...
1
vote
1answer
233 views

How to update the features setting to existing scratch org?

I'm trying to develop in a scratch org. When creating a scratch organization, specify the configuration file with a command to create a scratch org. After creating the scratch org, I noticed I forgot ...
0
votes
0answers
19 views

VS Code / Apex Code Completion: How to hint at multiple projects?

I'm using VS Code with the Salesforce extensions in a DX project. All works well and fine, except for one thing. My "main" project resides in .\force-app\main\.... I also have some "...
0
votes
1answer
59 views

To run all tests in Visual studio Code Sandbox:

I'm not able to see the Invoke apex tests option in ctrl+shift+P, do I need to download any additional extension for that?
1
vote
1answer
126 views

How to set up VS code so I can switch smoothly between different sandboxes?

I followed this really helpful guide to set up my VS Code environment and was able to get my Dev sandbox connected. Now I want to connect another sandbox (e.g. QA) to my VS Code because my goal is to ...
0
votes
0answers
81 views

Running Unit Test from VS Code Got: ERROR running force:apex:test:run: Cannot read property 'message' of undefined

I am facing the following issue when I run a UnitTest using VS Code. For instance: sfdx force:apex:test:run --tests ServiceTest --resultformat human --outputdir /salesforce/.sfdx/tools/testresults/...

1
2
3 4 5
8