SPFx feature definition and the description field results in "Deployment failed"

SPFx feature definition and the description field results in "Deployment failed"

Thank you, Microsoft, for the day I lost. With SPFx you can also create features (when you create an extension, this is generated automatically). The JSON schema then looks like this:

"features": [
      {
        "title": "My Fancy Feature",
        "description": "My Description",
        "id": "a44ee9cd-a94e-4091-b495-fcaa059ca0c7",
        "version": "1.0.0.0",
        "assets": {
          "elementManifests": [
            "elements.xml",
            "ClientSideInstance.xml"
          ]
        }
      }
    ]

So far so good. I now want to customize the title and also the description. Because I have no idea what to write in the description, I leave it empty. Now my JSON looks like this (title has been changed. Description field exists, but is empty):

"features": [
      {
        "title": "Customer XYZ: ...",
        "description": "",
        "id": "a44ee9cd-a94e-4091-b495-fcaa059ca0c7",
        "version": "1.0.0.0",
        "assets": {
          "elementManifests": [
            "elements.xml",
            "ClientSideInstance.xml"
          ]
        }
      }
    ]

Then the package will be deployed. Aaaaaand...

Deployment Failed. Correlation Id, if description field is empty

Ooookay...

WTF Captain Jack Sparrow meme

What can be the reason? From the error message you know of course IMMEDIATELY what the reason is o.O

It took me a whole day to find the solution (because I suspected it was one of my lists, content types or, site columns). It is actually, the empty value of the description. You don't even suspect something like that, because in SP Farm Solutions you could leave the description blank, without error. If you look at the JSON schema (developer.microsoft.com/json-schemas/spfx-b..), you can see that the description field is required.

JSON schema for feature

Well, it is specified in my JSON, just empty. For fun I just typed in a blank character, that works ¯\_(ツ)_/¯

"description": " ",

facepalm meme

Did you find this article valuable?

Support $€®¥09@ by becoming a sponsor. Any amount is appreciated!