3

I have created a project named "HelloWorldLightningWebComponent", and created a LWC component to it. While deploying the source to org from VSC, getting the error message. I have checked the version in both lwc's meta file and also sfdx-project.json file, its the same (45.0). Any ideas what is missing?

Also verified the source org for component with same name and didnt find any.

<?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>
{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "45.0"
}
5
  • Please share the code, without that it's hard to tell what's wrong? Apr 13, 2021 at 19:09
  • ye, and project structure if possible
    – ytiq
    Apr 13, 2021 at 19:18
  • @MohithShrivastava Added the meta file and sfdx-project.json files.
    – Vignesh V
    Apr 13, 2021 at 19:27
  • @ytiq There is no change to project structure. Have created one as per trailhead module (trailhead.salesforce.com/content/learn/projects/…)
    – Vignesh V
    Apr 13, 2021 at 19:30
  • @vignesh Can you reach out to me on mohith.shrivastava@salesforce.com Apr 14, 2021 at 12:46

9 Answers 9

3

JSON suffix error. It happened to me and I changed the repository name from "lwc" to "LWC" and solved the problem.

3
  • Additionally "lwc" should not be used as a name for any parent folder in the project path.
    – burntsugar
    Jan 10 at 0:33
  • In my case, I was trying to be organized and created ~/dev/lwc and moved all of my existing apps into this dir. This is what caused the issue. As soon as I renamed ~/dev/lwc to ~/dev/SOMETHINGELSE, deploys started working again.
    – DustinB
    Feb 8 at 16:59
  • I filed an issue about this github.com/forcedotcom/cli/issues/1395
    – DustinB
    Feb 8 at 17:37
1

This error happens if you already have a Lightning Web Component in your instance with the same name that you are trying to create a new one.

Hence make sure to use a New org if you are doing a Trailhead or refresh all the components from your org using the Org Browser to make sure you are editing instead of adding a new one.

0

Not sure if that was the cause but I accidently created the new project under main folder of another project and when I was trying to deploy I got this error . Later I deleted the new project folder and made separate folder and I was able to deploy the component .

0

I had the same issue. Turns out it was a typo in my test folder name, I had an extra underscore in the folder name.

0

for my situation, it seems cause by a experimental feature "salesforcedx-vscode-core.experimental.deployRetrieve". go to file > preference and disable deployRetrieve

0

I had a similar error. In my case I had a folder named lwc in the navigation path to the actual location of the of the project. And I had another component at the same level as the correct one. Once I removed the entire folder of the extra component and updated the lwc folder, I was able to get past this error.

0

Just experienced the same issue. It's because I tried to delete files in my current project and authorize/deply to org from there. Resolved when I created a new project for the new files.

0

I saved my project by mistake inside another projects's force-app\mian\default\lwc. Changed the location and that solved the problem.

0

Make sure that none of the folders in the Project path has name "lwc". I faced this issue as well, and fixed it by changing the name of a subfolder named "lwc" in the project-path to something else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.