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
raSFUserraSFUser 

Create a Hello World Lightning Web Component (Deploy Error)

I am currently trying to complete the trailhead 'Create a Hello World Lightning Web Component' section where you deploy the lightning web component from VSCode to your org, and im hitting the below error.

Starting SFDX: Deploy Source to Org

18:12:03.382 sfdx force:source:deploy --sourcepath c:\Users\ravent\Documents\SFDX Projects\HelloWorldLightningWebComponent\force-app\main\default --json --loglevel fatal
18:12:07.153 sfdx force:source:deploy --sourcepath c:\Users\ravent\Documents\SFDX Projects\HelloWorldLightningWebComponent\force-app\main\default --json --loglevel fatal ended with exit code 1

sf:UNSUPPORTED_API_VERSION: UNSUPPORTED_API_VERSION: Invalid Api version specified on URL

 

helloWorld error

As far as i can see i have followed the instructions to the letter, and cant seem to correct the error.

Any suggestions would be greatly appreachiated.

Best Answer chosen by raSFUser
raSFUserraSFUser

worked it out, for anyone else seing this issue run the below command in CLI:

sfdx force:config:set apiVersion=45.0 --global

Also make sure that your project json is set:

sfdx-project.json
 

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "45.0"
}

And that the example helloWorld xml api element provided also matches:

helloWorld.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
  <apiVersion>45.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>

 

All Answers

raSFUserraSFUser

worked it out, for anyone else seing this issue run the below command in CLI:

sfdx force:config:set apiVersion=45.0 --global

Also make sure that your project json is set:

sfdx-project.json
 

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "45.0"
}

And that the example helloWorld xml api element provided also matches:

helloWorld.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
  <apiVersion>45.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>

 
This was selected as the best answer
Shilpa SrikantacharShilpa Srikantachar
I am  also currently trying to complete the trailhead 'Create a Hello World Lightning Web Component' section where you deploy the lightning web component from VSCode to your org, and im hitting the below error.

I do not see the Component in the Default org later to add to the App builder . 


Starting SFDX: Deploy Source to Org
00:19:34.851 sfdx force:source:deploy --sourcepath /Users/admin/Documents/Documents/HelloWorldLightningWebComponent/force-app/main/default --json --loglevel fatal
00:20:31.407 sfdx force:source:deploy --sourcepath /Users/admin/Documents/Documents/HelloWorldLightningWebComponent/force-app/main/default --json --loglevel fatal ended with exit code 0
=== Deployed Source
STATE FULL NAME TYPE PROJECT PATH
───── ────────────────────────── ──────────────────────── ────────────────────────────────────────────────────────────
Add helloWorld/helloWorld.html LightningComponentBundle force-app/main/default/lwc/helloWorld/helloWorld.html
Add helloWorld/helloWorld.js LightningComponentBundle force-app/main/default/lwc/helloWorld/helloWorld.js
Add helloWorld/helloWorld.js LightningComponentBundle force-app/main/default/lwc/helloWorld/helloWorld.js-meta.xml

Any suggestions to set this correct is highly appreciated .

Thanks
Shilpa
AAYUSHI SHRIVASTAVAAAYUSHI SHRIVASTAVA
Hi Shilpa, I am facing the same issue as yours. Did you solve it? And how did you solve it?
PRADEEP KUMAR M 4PRADEEP KUMAR M 4
Hi Shilpa, I'm facing the same issue how to resolve it??
PRADEEP KUMAR M 4PRADEEP KUMAR M 4
HI Aayushi did u resolve the problem can u help me?
 
Luv Kumar Aidasani 4Luv Kumar Aidasani 4
Hi Shilpa,
To everyone who faced the same issue, the above message on the console of the Visual Studio Code is not an error. When you open the org and go to Edit the Page via Settings, all you have to do is look for helloWorld in the Components section under Custom

User-added image 
Aman nemaAman nema
I were also facing the same issue.

I enabled Dev Hub on my SFDC org and then my issue was fixed
Nicola MitchamNicola Mitcham
Thanks Aman
Tinashe Mutsungi Shoko 31Tinashe Mutsungi Shoko 31
Its case sensitive apparently lol
Shabnam ShaikhShabnam Shaikh
I am creating a hello world lightning web component but continuously an error has been occurring " We couldn't find a lightning web component named 'helloWorld' " bt my component deployed and also i added that component on page but still i am facing this issue
Please help me