Skip to main content Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

#Trailhead Challenges2,376 discussing

Hands-on challenges are the “secret sauce” of Trailhead. Before searching for solutions to superbadge challenges, review the Salesforce Certification Program Agreement and Policies.

Hello,

 

I'm currently trying to complete my Salesforce playground set up in Visual Studio Code. When trying to select SFDX: Create a Project, nothing happens. Towards the bottom an "Activating Extensions" blurb comes up then goes away after about 5 seconds and I'm not prompted to do anything else. 

 

#Trailhead Challenges  #Visual Studio Code Salesforce Extensions

16 answers
  1. Oct 22, 2024, 3:10 PM

    Hi @Anthony Martin,

    When you install -

    • First install Salesforce CLI
    • Second Salesforce Extension pack in the VS Code
    • Try to restart the VS Code
    • Then try to put SFDX in the VS Code terminal 
0/9000

Hi !

 

Step : Set Up Your Salesforce Mobile Developer Tools for Lightning Web Components > Use Salesforce Mobile Developer Tools

 

sub step: SFDX: Preview Component Locally

after install @salesforce/lwc-dev-mobile

close and re-open visual studio

 

Android studio is open.

Device is create for simulation.

(I tested running the simulator directly before and everything is fine.)

 

Error : 

Starting SFDX: Start Local Development Server

09:33:51.221 sfdx force:lightning:lwc:start

Starting SFDX: Preview Component Locally

09:33:51.326 sfdx force:lightning:lwc:preview -p Android -t Android1 -n c/bikeCard -a browser -d c:\Salesforce\Formation\bikeCard --loglevel warn

(node:1860) 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)

(node:21892) 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: @salesforce/cli update available from 2.26.10 to 2.27.6.

» Warning: @salesforce/cli update available from 2.26.10 to 2.27.6.

» Warning: force lightning lwc start is not a sf command.

Did you mean force lightning lwc test run? [y/n]:

» Error: Run sf help force for a list of available commands.

09:34:06.773 sfdx force:lightning:lwc:start

ended with exit code 127

Error: To run this command, install the @salesforce/lwc-dev-server plugin. For more info, see [Set Up LWC Local Development](https://developer.salesforce.com/tools/vscode/en/localdev/set-up-lwc-local-dev).

> Requirements

> Checking SDK root location

> Checking Android SDK Prerequisites

> Checking Android Command Line Tools

> Checking SDK Platform Tools

> Checking SDK Platform API

> Checking SDK Platform Emulator Images

› SfError: SDK root location not found. Please set up ANDROID_SDK_ROOT or ANDROID_HOME in your environment.

› SfError: Android command line tools not found.

› SfError: No supported Android platform tools found. Minimum supported Android platform tools version is 23.

› SfError: Android SDK is missing prerequisites: Android SDK root is not set.

› SfError: No supported Android API package found. Minimum supported Android API package version is 23.

› SfError: Install at least one of these emulator images: google_apis,default,google_apis_playstore

√ Requirements (0.000 sec)

Error (1): Requirement verifications for platform %s failed.

Try this:

Please see the error messages above for details on resolving your requirement issues.

09:34:11.483 sfdx force:lightning:lwc:preview -p Android -t Android1 -n c/bikeCard -a browser -d c:\Salesforce\Formation\bikeCard --loglevel warn

ended with exit code 1

Error: Failed to start Android Emulator 'Android1'.

Android1 is the good name for the emulator. (cf screen 001)

pbl_salesforce_emulation_001.jpg

They say to install the @salesforce/lwc-dev-server plugin... so i do it.

 

Error : 

PS C:\Salesforce\Formation\bikeCard> sf plugins install @salesforce/lwc-dev-server

» Warning: @salesforce/cli update available from 2.26.10 to 2.27.6.

Polling for new version(s) to become available on npm... done

Successfully validated digital signature for @salesforce/lwc-dev-server.

Finished digital signature check.

Installing plugin @salesforce/lwc-dev-server@latest... failed

» Warning: @salesforce/lwc-dev-server > @oclif/config@1.18.17: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Error: C:\Users\xxxx\AppData\Local\sf\client\2.26.10-b796e35\node_modules\yarn\bin\yarn.js add @salesforce/lwc-dev-server@latest --non-interactive

--mutex=file:C:\Users\xxxx\AppData\Local\sf\yarn.lock --preferred-cache-folder=C:\Users\xxxx\AppData\Local\sf\yarn --check-files exited with code 1

PS C:\Salesforce\Formation\bikeCard>

Well : Package no longer supported.

ok....

 

start/stop vs

launch again SFDX: Preview Component Locally

(Is it normal that it always takes so long to get started?)

 

same error than first... so i search for the other error...

 

› SfError: SDK root location not found. Please set up ANDROID_SDK_ROOT or ANDROID_HOME in your environment.

› SfError: Android command line tools not found.

› SfError: No supported Android platform tools found. Minimum supported Android platform tools version is 23.

› SfError: Android SDK is missing prerequisites: Android SDK root is not set.

› SfError: No supported Android API package found. Minimum supported Android API package version is 23.

› SfError: Install at least one of these emulator images: google_apis,default,google_apis_playstore

well.... first error missing sdk root location... This seems like an obvious error seen like that... but in fact, no...

 

However, I installed Android Studio in accordance with the previous exercise. I did not find in the trailhead where we must indicate where the path of this environment variable (ANDROID_SDK_ROOT) is and especially what value to put there. I have no idea where the android sdk is...  For ANDROID_HOME it's c:\users\<username>\.android ?

Should we install the Android SDK in addition to the Android simulator ?

 

I welcome all help!

THANKS !

Regards,

C.

9 answers
  1. Feb 13, 2024, 2:24 PM

    next...

     

    re-launch command : 

     

    sfdx plugins:install @salesforce/lwc-dev-server

    failed...

     

    Installing plugin @salesforce/lwc-dev-server@latest... failed »   Warning: @salesforce/lwc-dev-server > @oclif/config@1.18.17: Package no longer »   supported. Contact Support at https://www.npmjs.com/support for more info.    Error: C:\Users\xxxxxxx\AppData\Local\sf\client\2.26.10-b796e35\node_    modules\yarn\bin\yarn.js add @salesforce/lwc-dev-server@latest    --non-interactive    --mutex=file:C:\Users\xxxxx\AppData\Local\sf\yarn.lock    --preferred-cache-folder=C:\Users\xxxxx\AppData\Local\sf\yarn    --check-files exited with code 1

     in the page https://developer.salesforce.com/tools/vscode/en/localdev/set-up-lwc-local-dev they have it easy. After giving the instruction, they point out that there are problems. Then suggest to see the installation and if it's ok, then it's ok... but there's absolutely nothing to say what to do if it's not ok... Oo

     

    try again the command (thx Booker EVail )

    npm install -g @salesforce/lwc-dev-server

    failed...

    lot of "deprecated" and "not supported"...

    problem with python... 

    re-install python (https://www.python.org/downloads/) for all users

    re-launch command

     

    failed

    too long cf pj log.txt

    cf log, we must install visual studio 2019 (or other version) in addition to visual studio code ?

     

    This is all totally mind-blowingly complicated...  :/

     

    Synthetic 2024-02-13 15h56 :

     

    - All problems launching the emulator are resolved. I manage to display the Android emulator and it tries to connect to the simulated site.

     

    - I have a problem installing the server. The tested commands crash on errors that I can't understand. The impact is that the Android emulator opens the browser, tries to connect to the site URL but cannot find it and returns a classic site not found error.

0/9000

I am trying to connect VS Code to  playground SF Org but getting below error. Can someone help on this ? 

 

Error authenticating with auth code due to: request to https://login.salesforce.com//services/oauth2/token failed, reason: self-signed certificate in certificate chain

 

This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.

 

8 answers
0/9000

New Playground was created. CLI was download and >sf update command executed successfully. Visual Studio Code with the SF Extension Pack (Expanded) was previously installed.

We set up the new Dreamhouse project with SFDX: Create Project.

When we were asked to run SFDX: Authorize an Org it was not found in the Command Prompt of Visual Studio Code.   Any help is greatly appreciated! Thanks!

 

#Trailhead Challenges

5 answers
  1. Jan 7, 3:02 PM

    Solution: 

    When the CLI was installed (December 2024), it set up C:\Program Files\sfdx\bin in the global environment path. 

    Salesforce CLI Command Reference | Salesforce Developers 

    Indicates that sfdx commands were deprecated on June 12 2024. 

    Using Windows command prompt, we confirmed there was no ‘C:\Program Files\sfdx\bin’. 

    There was ‘C:\Program Files\sf\bin’ present, so we made the necessary change in the global environment path.   

     

    We re-opened Visual Studio Code and reopened the Dreamhouse folder.  The application could see all of the SFDX commands, but a warning came up the Java Development Kit (JDK) was out of date and failed. 

    After we installed the 17.0.8 JDK and reopened Visual Studio Code/Dreamhouse folder everything worked as expected. 

0/9000

In the Find and Fix Bugs with Apex Replay Debugger project Debug Your Code assessment, I can't find anything in SFDX about checkpoints. Screenshot 2024-12-23 at 19.17.44.pngWithout this I can't proceed and just end up with the error:

"We did not find any checkpoints for 'AccountService'. Make sure to select a line number in the Apex class and run the commands 'SFDX: Toggle Checkpoint' then 'SFDX: Update Checkpoints in Org' in Visual Studio Code."

 

#Trailhead Challenges

5 answers
  1. Dec 23, 2024, 8:21 PM

    Hi, @Alan McClenaghan

     

    Make sure you have the Salesforce CLI and all required VS Code plugins installed and activated.

     

    You can find a list and instructions for them in these Challenges

     

    Sincerely, 

    Mykhailo Vdovychenko 

    Bringing Cloud Excellence with IBVCLOUD OÜ

0/9000
2 answers
  1. Dec 19, 2024, 2:40 PM

    Hi, @siddhesh gawde

     

     Try following the instructions in this Trailhead. It provides a clear step-by-step guide on how to set up and configure the working environment for VS Code and Salesforce. 

     

    1. https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/set-up-salesforce-dx

    2. https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/set-up-visual-studio-code

     

    Sincerely, 

    Mykhailo Vdovychenko 

    Bringing Cloud Excellence with IBVCLOUD OÜ

0/9000

 It says "activating extensions" on the bottom left of the Visual Studio tab, but then it just disappears and the options "Standard/Empty/Analytics" doesn't show up in the search bar like they do in the instructional video at 13:38. Nothing shows up at all. I've never coded before and have never used a command line or any coding applications. I followed the instructions and downloaded Salesforce CLI and Visual Studio on my Windows computer. I also downloaded the SF Extension package. Am I missing a step? Should I have downloaded something related to Java? I don't even know what Java is, other than a programming language.... 

 

Here are the instructions provided in the trailhead lesson. I am stuck at step 3.  

 

Create a Salesforce DX Project

Now that you’ve set up your development environment, you can create a simple Lightning web component.

  1. In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
  2. Type SFDX.
  3. Select SFDX: Create Project.
  4. Press Enter to accept the standard option.
  5. Enter HelloWorldLightningWebComponent as the project name.
  6. Press Enter.
  7. Select a folder to store the project.
  8. Click Create Project. You should see something like this as your base setup.
6 answers
  1. Dec 19, 2024, 6:54 AM

    @Karri Lauritzen

    • Open VS Code
    • Go to Extensions (Press ctrl+shift+X)
    • Search for Salesforce Extension Pack, make sure it is installed
    • Close/refresh VS Code then try again
0/9000

I followed the directions in the "Set Up Visual Studio Code" section of the "Find and Fix Bugs with Apex Replay Debugger" Project. At the very end, when I search for "apex java" in the settings of Visual Studio Code, I can't find where I am supposed to "Configure Java Home Setting for Apex Support". The SF Extension Pack is downloaded. Did I miss a step or do something wrong?

Screenshot 2024-12-04 135107.png

 

 

#Trailhead Challenges

0/9000

Any help available, got an error Static Analysis Failed. Error Details: PMD Command Failed!  Enable "Show StdErr" setting for more info. Where does I need to go to enable it?

Apex Class.PNG

6 answers
  1. Nov 15, 2024, 2:46 PM

    Hi, @Lluwellyn Nuwegeld

     

    In this case, I would recommend reinstalling your VS Code, as well as everything related to Salesforce development.

     

    How to do this? There's a great Trailhead that provides step-by-step instructions:

     

    Sincerely, 

    Mykhailo Vdovychenko 

    Bringing Cloud Excellence with IBVCLOUD OÜ 

0/9000

As I'm following the trailhead module link below, on step 8 of the section "Use the Simulator with Visual Studio Code", I tried to right-click on bikeCard folder and selected "SFDX: Preview component locally" but it does nothing. Similarly, I tried to do it inside the command palette in VS code and I get the following error message:

Screenshot 2024-10-25 at 10.56.25 AM.png

Does anyone know how to get around this problem?

 

https://trailhead.salesforce.com/content/learn/projects/set-up-your-salesforce-mobile-developer-tools-for-lightning-web-components/use-salesforce-mobile-developer-tools?trail_id=force_com_dev_advanced&trailmix_creator_id=strailhead&trailmix_slug=developer

 

#Trailhead Challenges

0/9000