1

Does anyone have any ideas on how to fix this? It just randomly started happening when using vscode:

enter image description here

This is how my current sfdx-project.json file looks like:

enter image description here

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true,
      "dependencies": [ 
        {
           "package": "PACKAGENAME@1.1.0.4"
        }
     ]
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "45.0",
  "packageAliases": {
      "PACKAGNAME@1.1.0.4": "VERSIONID"
  }

}
  • could you share your sfdx-project.json file ? – Mohith Shrivastava Apr 5 at 19:36
  • @MohithShrivastava done! – scarecrow Apr 5 at 20:39
  • @scarecrow can you provide a text version of the file as well? Easy to copy paste if someone wants to replicate. – Jayant Das Apr 5 at 20:52
  • @JayantDas Done – scarecrow Apr 5 at 21:01
3

Looks like in your sfdx-project.json file the package and VersionNumber are both missing .

package - This is the name identifier for the package .

VersionNumber - This is required by the CLI to know what to generate next when CLI commands for version generate is executed .

Check the updated specification here. ESlint rules have been updated as well I believe in the CLI causing the issues.

The below seems to be working for me

 {
"packageDirectories": [{
    "path": "force-app",
    "default": true,
    "package": "PACKAGNAME",
    "versionNumber": "1.1.0.NEXT",
    "dependencies": [{
        "package": "PACKAGENAME@1.1.0.4"
    }]
}],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "45.0",
"packageAliases": {
    "PACKAGNAME@1.1.0.4": "VERSIONID"
 }

}
  • So I now have to generate a package for a non ready app? thats a bummer – scarecrow Apr 5 at 21:20
  • Not generate package .Sorry if I am unclear you just have to choose the name for it .Usually it is not needed when you have no package to begin with but when you generate one the cli auto adds this info .Since you already had this that's why eslint is throwing an error .All you need is to assign some name . – Mohith Shrivastava Apr 5 at 21:21
  • +1. I did come through the docs you mentioned but did not realize that those attributes are marked as required in case of packaging. – Jayant Das Apr 5 at 21:34
  • Interesting, I don't even have a package version created for the this app so I guess I will go and generate one. Very interesting change that it is now required guess I shouldnt have restarted vscode! – scarecrow Apr 5 at 21:39
  • You don't have to create one .Just say 0.0.1.NEXT – Mohith Shrivastava Apr 5 at 21:40

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.