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
JPSeaburyJPSeabury 

HTML Template Not Created when trying to create Lightning Web Component

I'm working on the Quick Start: Lightning Web Components Trailhead badge and running into an issue which I think must be related to not setting up my DX Environment correctly.  In module 3 (Create a Hello World Lightning Web Component), I've followed the instructions in the section labeled Create a Lightning Web Component.

The screenshot in the Trailhead module doesn't look at all similar to my results. For the author, their screenshot shows the creation of a helloworld.html, helloworld.js and helloworld.js-meta.xml files. I get the traditional cmp, controller and related files (see my screenshot below).

User-added image

This suggests to me that I've missed something basic, but I've followed the pre-reqs:

1.) I've downloaded / installed Visual Studio Code and the Salesforce Extensions for VS Code
2.) I've verified I'm running a pre-release version of the Salesforce CLI (45.0.12) 

User-added image

3.) I created a PreRelease19 Developer Edition Org of Salesforce, enabled Dev Hub, and authorized it, created a scratch org. 

 

I can't see where I went astray in the trailhead module that caused me to get traditional lightning component artifacts, rather than prerelease lightning web component artifacts (.html, .js, etc.)


Here are my VS logs, in case their useful (I didn't see any clues in them):

Starting SFDX: Authorize a Dev Hub

11:02:58.22 sfdx force:auth:web:login --setdefaultdevhubusername
Successfully authorized ********@force.com with org ID 00DB0000000Tka0MAC
You may now close the browser
11:03:36.238 sfdx force:auth:web:login --setdefaultdevhubusername ended with exit code 0

Starting SFDX: Create a Default Scratch Org...

11:07:04.767 sfdx force:org:create -f config\project-scratch-def.json --setalias HelloWorldLightningWebComponent --durationdays 7 --setdefaultusername
Successfully created scratch org: 00DZ000000NEMayMAH, username: ********@example.com
11:07:20.31 sfdx force:org:create -f config\project-scratch-def.json --setalias HelloWorldLightningWebComponent --durationdays 7 --setdefaultusername ended with exit code 0

Starting SFDX: Create Lightning Component

11:11:14.334 sfdx force:lightning:component:create --componentname helloworld --outputdir force-app\main\default\aura
target dir = c:\Salesforce\HelloWorldLightningCmp\HelloWorldLightningWebComponent\force-app\main\default\aura
   create helloworld\helloworld.cmp
   create helloworld\helloworld.cmp-meta.xml
   create helloworld\helloworldController.js
   create helloworld\helloworldHelper.js
   create helloworld\helloworld.css
   create helloworld\helloworldRenderer.js
   create helloworld\helloworld.svg
   create helloworld\helloworld.auradoc
   create helloworld\helloworld.design

11:11:18.13 sfdx force:lightning:component:create --componentname helloworld --outputdir force-app\main\default\aura ended with exit code 0

 

Where did I go astray? What can I check to validate that I have my SFDX Env setup correctly?

Best Answer chosen by JPSeabury
JPSeaburyJPSeabury

Aha! the lwc folder is empty, but your post helped point me in the right direction.

I typed "Create Lightning Component" as a VS Code command. That creates the traditional lightning components in the /aura directory.

I SHOULD have typed "Create Lightning Web Component", which presumably will create the .html, .js and .xml files in the lwc directory.

So this was a PBKAC issue, oops! Thanks for chiming in, Naveen!

All Answers

Naveen KNNaveen KN
Hi JPSeabury,

I see that you are checking the file in this path --> main > default > aura

In the module it is main > default > lwc

As per your comments on the status of installation, I think lwc will have all the files. Please check and confirm back. 

Naveen
Team codengine.in
JPSeaburyJPSeabury

Aha! the lwc folder is empty, but your post helped point me in the right direction.

I typed "Create Lightning Component" as a VS Code command. That creates the traditional lightning components in the /aura directory.

I SHOULD have typed "Create Lightning Web Component", which presumably will create the .html, .js and .xml files in the lwc directory.

So this was a PBKAC issue, oops! Thanks for chiming in, Naveen!

This was selected as the best answer
Naveen KNNaveen KN
We are glad to know that it pointed to the right direction. 

As always we are happy to troubleshoot salesforce related issues in this forum.

Please mark as solved in case if everything is working good. so that we can close this thread. 

Naveen
Team codengine.in