function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Frederick H LaneFrederick H Lane 

Visual Studio Code - New Lightning Component doesn't create .html or .js file

I've created my project(LWCSessions), authorised my Dev Org, created my Scatch Org and now want to build a component HelloAimitTraineesUser-added imageUser-added image. So, I created one but, it only creates .cmp  and .auradoc  folders as per the screenshot. I notices when I created the Lightning component, taht the folder mapping automatically maps to an Aura sub-folder which is, what I suspect is causing the problem. But how do a change the mapping to, for example, LWCSessions -> force-app -> main - default -> lwc?
Also, if I simply create 2 folders for .html and .js, is that sufficient?
subodhsubodh
Hi Frederick,
first install JDK 8 ,or JDK 11. I think it will work.

Thanks
Subodh
Aimit SalesAimit Sales
What are JDK 8 and 11 and why are they not explained in any tutorials for setting up VS Code? Why have themand where to download to? My local computer or as a VS Code extension? Also, It think the problem could be around terminology and understanding of the VS Code UI. Because, I now discover that to can create a Lightning Component (with Aura framework tags), or you can create a Lightning Web Component (with HTML tags). And then it depends on which file you are clicked into on the left side file  menu. Can you advice please?
Ajay K DubediAjay K Dubedi
Hi Frederick,

I hope you are doing well. In Lightning Web Component three files have created
1. HTML file
2. JavaScript file
3. XML file

Each Lightning web component folder must include a configuration file named <component>.js-meta.xml.
The configuration file defines the metadata values for the component, including the design configuration
for the Lightning App Builder and Community Builder.

you can follow this link to know more about XML file:
https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_configuration_tags

you should follow this link for vs code related issue.
https://www.sfdcpanther.com/how-to-setup-visual-studio-code-and-salesforce-dx/
https://trailhead.salesforce.com/en/content/learn/projects/quick-start-lightning-web-components/set-up-visual-studio-code

You can follow this link for LWC related issue:
https://trailhead.salesforce.com/en/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks,
Ajay Dubedi
Frederick H LaneFrederick H Lane
Very Helpful thanks Ajay. Just getting into this whole L.C subject but I feel VS Code is all part of it. I find it all very new and it seems a little clunky, even though, to developer puerists, it is a wonderful all-in-one IDE, compiler, org launcher, tester etc. 
But, what is the reason I was recommended JDK 8 and 11? 
Also, as I'm doing the Trailhead module on Salsforce DX, I pass all of the stages except the very last point which says I dont have Dev org enabled, BUT! when you have a Scratch org, it's not possible to configure the enablement feature? So, it's not possible to pass the challenge either.
Ajay K DubediAjay K Dubedi
Hi Frederick,

You should install Java 8 Platform, Standard Edition Development Kit and make sure you set a path for JDK. 
Some features in Salesforce Extensions for VS Code depend upon the Java 8 Platform, Standard Edition Development Kit (JDK).
If you don’t already have the JDK installed, 
- install the latest version of the Java 8 JDK from Java SE Development Kit 8 Downloads.
- Visual Studio Code v1.17 or later
- Salesforce Extensions for VS Code
- Code smartness for sObjects in Apex code is powered by the salesforcedx-vscode-core extension.
  We suggest that you install all extensions in the salesforcedx-vscode extension pack.
- It's a must that you need to have Java8 platform for this

You can follow this link to set a JDK path in your system:
https://www.geeksforgeeks.org/set-temporary-permanent-paths-java/

Yes first you have to enable a dev org after creating scratch org follow all step from beginning to last 
to your fist and second module of Salesforce DX.

Trailhead (Create and Test Our Scratch Org) Module you need to create a new scratch org to use the following command:
- sfdx force:org:create -s -f config/project-scratch-def.json -a dreamhouse-org
You can follow this link for more help:
https://www.youtube.com/watch?v=X7TWL7_Gxso
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_workspace_setup.htm

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks,
Ajay Dubedi
Frederick H LaneFrederick H Lane
Thanks Ajay,
I have followed all your steps, watch the videos (One of which is a walk-through the challenge).
But!  I am getting the error message "There was an issue processing your verification. Please refresh the page and try again."
So, the steps I took were;
Installed JDK 8 and checked in my settings that is in the user variables (Still don't understand why this matter? Because, why is it not prioritised in the Trailhead?)
Installed the SFDC package extension + others
Sset up my Github with auto-sync of data
Created a project
Created a new Playgroundand ensured Dev Hub was enabled
Assigned a scratch org
Pulled the data from the Dreamhouse repo
Pulled the sample data
Tested it. Everything is there.
But, the challenge won't pass.

I've also cleared my cache. Why does the output on the Ui all work but Trailhead track an error?
One other question, when I launch my Scratch org, it always launched in Opera rather than Google. How can I change this?


 
Frederick H LaneFrederick H Lane
Is anyone able to help?