Skip to main content The new Salesforce certifications experience is live! Visit Trailhead Academy to explore your new certifications homepage.
Im working through the Trailhead module - Quickstart: Lightning Web Components and have hit a roadblock with SFDX Create Component, for a project set up using Visual Studio Code.   

 

I set up the HelloWorldLightningWebComponent Project successfully (all the right files seem to be there), and the Trailhead org was successfully authorised (right confirmation message shown as per trailhead module).

 

Next step is where the problem occured - the SFDX Create Component command allowed me to put in the name of the File 'helloWorld' but the default folder offered was force-app/main/default/aura instead of force-app/main/lwc.     

 

Leaving it at the default folder resulted in all the files created under the aura sub-folder, and do not reflect the example given I.e there is no 

 

helloWorld.html 

 

helloWorld.js 

 

helloWorld.js-meta.xml

 

Instead a bunch of Aura type files are created, under the aura sub-directory. 

 

I tried changing the folder to the lwc one, with the result that it just created a subfolder again with aura type files in there.

 

Does any one have any ideas why, and how to fix it?  Im not going to be able to progress without the java  .html files being created..   Any pointers would be much appreciated!

 

Some other (potentially) relevent info:

 

 - CLI - VERSION sfdx-cli/7.8.1-8f830784cc darwin-x64 node-v10.15.3 (latest!)

 

 - java version "1.8.0_211"

 

Java(TM) SE Runtime Environment (build 1.8.0_211-b12)

 

Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

 

- VIsual Studio Code Version 1.33.1 (1.33.1)

 

- VS extensions include Apex, Web Lightning Components,Salesforce Extension pack (latest)

 

 
8 answers
  1. Jun 3, 2019, 2:55 PM

    First line where you said has the issue:

    SFDX: Create Lightning Component

    You have to enter:

    SFDX: Create Lightning Web Component

  2. Jun 4, 2019, 6:20 AM
    Yes.  You are right. it works!  Create Lightning Web Component.  Thanks so much.
  3. Jun 3, 2019, 2:38 PM
    This is the default folder get shown when I enter SFDX: Create Lightning Component, and I enter helloWorld as file name, hit Enter.

     

     This is the default folder get shown when I enter SFDX: Create Lightning Component, and I enter helloWorld as file name, hit Enter.

     

    If I then try and select the lwc folder using Choose a Custom Directory, I get the list of available folders as this:

     

    VS Code Window on selecting 'Choose a Custom Directory'

     

    Note that the lwc folder exists under force-app/main/default/ , but that the available lwc folder includes subfolder as /lwc/aura...

     

    I am not able to select just the lwc folder, and if I select the ../lwc/aura folder I get the files created like this..

     

    VS Code Window after select only lwc related folder.. /lwc/aura

     

    What do you think?

     

     
  4. Jun 3, 2019, 7:37 AM
    Can you please post the screenshot of your VSCode.

     

    How are you trying to create.

     

    As i just tried and it shows an option of lwc folder as default.

     

    1. Ctrl + Shift + P -> Select Create Lighnitng Web Component

     

    2. Enter desired fileName

     

    3. It asks you to enter folder by giving an option of lwc folder.

     

     
  5. Jun 3, 2019, 7:32 AM
    Thanks for your suggestions.

     

    Sakthivel - I tried deleting the Project and setting it up again from scratch (several times)and the problem stil persists; I'll try the re-install of VSC and let you know if that fixes it.  

     

    Payal - I'm using Ctrl+Shift+P, and it is not defaulting to the lwc folder unfortunately, and won't even allow me to select it.

     

    Any other ways anyone can think of to investigate/resolve this; it seems that none of the java type files are being created, just the aura ones..?
  6. Jun 3, 2019, 4:59 AM
    Hi Jacqui ,

     

    How are you creating Lightning component.

     

    Using Ctrl+Shift+P or by executing command manualy form terminal.

     

    When you use keys Ctrl+Shift+P -> Then search for Create Lightning Web Component which defaults to lwc folder.
  7. Jun 2, 2019, 11:43 PM
    Hi Jacqui Lee,

     

    Can you try to delete the project and redo? if still the issue is occured then i recommend to reinstall the VSC and try it.

     

    Thanks & Regards,

     

    Sakthivel Madesh
0/9000