sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

SpFx Helloworld webpart does not show up under modern Page toolbox

Open Moreshwar83 opened this issue 9 years ago • 80 comments

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Category

  • Bug spfx issue

If you are planning to share a new feature request (enhancement / suggestion), please use SP Dev UserVoice at http://aka.ms/sp-dev-uservoice.

Expected or Desired Behavior

After adding SpFx webpart to site contents, the webpart should be available in toolbox for modern UI page in SharePoint online.

Observed Behavior

Cannot find Simple hello world webpart in modern UI page toolbox, although it is available under site contents.

Steps to Reproduce

Followed all steps as explained in article https://dev.office.com/sharepoint/docs/spfx/web-parts/get-started/serve-your-web-part-in-a-sharepoint-page However, stuck at last step, i.e. cannot add webpart to page.

Moreshwar83 avatar Aug 09 '17 15:08 Moreshwar83

Silly question, but can you scroll down in the modern page toolbox and see it lower?

patmill avatar Aug 09 '17 15:08 patmill

Offcourse I have tried it. The webpart cannot be seen at all. I was not able to put that together in screenshot. Below is full screen grab, if that helps spfx1

Moreshwar83 avatar Aug 09 '17 15:08 Moreshwar83

OK, just double checking. Did you get your part working on your local workbench and / or hosted workbench before uploading it to the app catalog?

If you type this into your browser (https://yourtenant.sharepoint.com/sites/yoursite/_api/web/GetClientSideWebParts) can you find your webpart listed?

If you go to your app catalog site, can you go to https://yourtenant.sharepoint.com/sites/yourappcatalog/Lists/ComponentManifests/AllItems.aspx and see your webpart in the list of available components?

patmill avatar Aug 09 '17 16:08 patmill

Hello Patmill, Please find my answers below:

Did you get your part working on your local workbench and / or hosted workbench before uploading it to the app catalog? Ans: Yes it is working on local workbench. If you type this into your browser (https://yourtenant.sharepoint.com/sites/yoursite/_api/web/GetClientSideWebParts) can you find your webpart listed? Ans: No, I cannot find it.

If you go to your app catalog site, can you go to https://yourtenant.sharepoint.com/sites/yourappcatalog/Lists/ComponentManifests/AllItems.aspx and see your webpart in the list of available components? Ans: No, I do not see it here as well

Moreshwar83 avatar Aug 09 '17 17:08 Moreshwar83

It started working now. Resolution:

  1. Go to ~appcatalog/AppCatalog/Forms/AllItems.aspx
  2. Edit properties for the web part, I added short description & Description and saved. Webpart started appearing under ~appcatalog/Lists/ComponentManifests/AllItems.aspx
  3. Removed and re-added webpart from dev site. It started showing up in page toolbox. I was able to add and see it on page as well.

Thank you for your guidance Patmill.

Moreshwar83 avatar Aug 09 '17 20:08 Moreshwar83

Glad you got it sorted out.

patmill avatar Aug 10 '17 00:08 patmill

@Moreshwar83 Thanks for pointing out to fill 'Description' and 'Short Description'. If there is no 'Description' and 'Short description' 'Client Side WebPart' don't show up in the modern page toolbox.

@patmill There seem to be bug in pulling 'Client Side WebPart' to show up in the modern page toolbox when 'Description' and 'Short Description' not filled in against the app in app catalog.

Dilli avatar Aug 23 '17 08:08 Dilli

If you check the schema of the web part manifest in ./node_modules/@microsoft/sp-module-interfaces/lib/manifestSchemas/IClientSideWebPartManifest.d.ts you can see that the description property is required. When you try to build the project without it, or with an empty value you will get a build error. Could you share your web part manifest so that we can see your configuration?

waldekmastykarz avatar Aug 23 '17 11:08 waldekmastykarz

@waldekmastykarz Firstly, the manifest path provided above does not seems correct in local. But managed to find the file in the following path '.\SPFx\helloworld-webpart\node_modules@microsoft\sp-module-interfaces\lib\manifestSchemas'. Please comment otherwise.

IClientSideWebPartManifest.d.ts.txt

I do see, the 'description' is not optional in the file, but could be bug in mappings. There is no mention about 'short description' field though in the very same file.

P.S I have added '.txt' extension to the file as the file type is not supported by git hub comments.

Dilli avatar Aug 24 '17 04:08 Dilli

@Dilli sorry, I shortened the path too much in my comment, you got it right. Where did you get the reference to 'short description' from? It doesn't seem to be mentioned anywhere.

waldekmastykarz avatar Aug 24 '17 08:08 waldekmastykarz

@waldekmastykarz , Myself picked the 'short description' from app catalog. Please ignore 'short description'.

Dilli avatar Aug 28 '17 04:08 Dilli

Hi @patmill @Moreshwar83

what would i do if i cant see it in the /_api/web/GetClientSideWebParts but it is present in the sites/appcatalog/Lists/ComponentManifests/AllItems.aspx. i still cant see it when i try to add my webpart

P.S: my webpart has description as well

paigeflourin avatar Nov 23 '17 03:11 paigeflourin

I'm experiencing the same behavior as @paigeflourin - worked last week (11/20), but now, the updated web part no longer appears in the web part gallery.

I did add a provisioning feature to my solution in addition to the web part - and I'm wondering if that is what is causing the web part to no longer appear. I tried a new build without the feature block in the package-solution.json file, but that does not seem to fix it.

My solution does not appear in the /_api/web/GetClientSideWebParts output, but it is shown in ~appcatalog/Lists/ComponentManifests/AllItems.aspx and has no error messages from deployment.

Any guidance is appreciated.

smithderekm avatar Nov 27 '17 20:11 smithderekm

I'm facing the same issue as @paigeflourin . Moreover when I try to unsinstall the app containing the webpart, it goes to recycle bin and shows zero KBs as size. I'm unable to delete it from solution from recycle bin and consequently unable to try updating the web part as well. Anyone else facing this issue?

vickeybird avatar Dec 19 '17 10:12 vickeybird

In my case, I found that when I added my own feature definition in the package-solutions file for provisioning, it was essentially overwriting the feature for the web part. The tooling generates the feature behind the scenes but never reveals it (annoying!) so my hand-entered feature caused the conflict.

The fix was to ensure that the package-solution file has 2 features with different IDs - one for the web part, and one for the provisioning. Once I did that, then the installation of the app put everything in the right place and the web part re-appeared in the gallery to place on a page.

Here's a sample package-solution.json to illustrate. You'll need to generate new guids for your solution/features.

{
  "$schema": "https://dev.office.com/json-schemas/spfx-build/package-solution.schema.json",
  "solution": {
    "name": "Hello World",
    "id": "300ecbc4-f139-459e-bb2d-bc3b1445a12c",
    "version": "1.0.0.0",
    "features": [
      {
        "id": "3be4d3fd-963b-4a1b-9607-cddb02c4cf16",
        "title": "Hello World Web part feature",
        "description": "A feature which activates the Client-Side WebPart named Hello World",
        "version": "1.0.0.0"
      },
      {
        "title": "Hello World Provisioning",
        "description": "Adds site columns, content types, lists for Hello World items.",
        "id": "f1c4625d-e32a-4960-8166-7610cdcb24d1",
        "version": "1.0.0.0",
        "assets": {
          "elementManifests": [
            "elements.xml"
          ]
          // ,
          // "elementFiles": [
          //   "schema.xml"
          // ]
        }
      }
    ]
  },
  "paths": {
    "zippedPackage": "solution/hello-world-webpart.sppkg"
  }
}

smithderekm avatar Dec 19 '17 14:12 smithderekm

Same problem as vickeybird here. Webpart not showing up and after removal there where several files in the recyclebin, one of those is 0kB. And that one can't be removed.

Edit: /_api/web/GetClientSideWebParts doesn't show the desired webpart appcatalog/Lists/ComponentManifests/AllItems.aspx shows the correct manifest

Denloof avatar Dec 19 '17 15:12 Denloof

Ok, after an update in sharepoint (??, recyclebin look/behaves differently) things seem to be working again. Was now able to remove the item and reinstall, now webpart shows up.

Denloof avatar Dec 20 '17 09:12 Denloof

@smithderekm

I did exactly what you did but it's still not showing up :( This is my package-solution.json

{
  "solution": {
    "name": "our-applications-client-side-solution",
    "id": "c23661a1-50a2-4b69-b8f2-9b7a7a5db2b1",
    "version": "1.0.2.9",
    "features": [
      {
        "id": "3be4d3fd-963b-4a1b-9607-cddb02c4cf16",
        "title": "Our Applications Web part feature",
        "description": "A feature which activates the Client-Side WebPart named Our Applications",
        "version": "1.0.2.9"
      },
      {
      "title": "our-applications-client-side-solution",
      "description": "our-applications-client-side-solution",
      "id": "523fe887-ced5-4036-b564-8dad5c6c6e24",
      "version": "1.0.2.9",
      "assets": {
        "elementManifests": [
          "elements.xml"
        ],
        "elementFiles":[
          "schema.xml"
        ]
      }
    }]
  },
  "paths": {
    "zippedPackage": "solution/our-applications.sppkg"
  }
}

paigeflourin avatar Jan 18 '18 03:01 paigeflourin

I have the same problem again... Update an existing webaprt (updated the version in package-solution.json) Update sppkg file in appcatalog (overwrite), shows new version number. Go to sitecolletion where the existing webapart was working, update to new version and nothing works... The webaprt isn't showing up anymore.

/_api/web/GetClientSideWebParts doesn't show the desired webpart appcatalog/Lists/ComponentManifests/AllItems.aspx shows the correct manifest

Removig reinstalling doesn't work, same result.

Am I missing something or is this just buggy?

Denloof avatar Jan 25 '18 15:01 Denloof

I also have this problem again now - but only on some sites. This seems to be really buggy and fragile.

Please advice!

Leif-Frederiksen avatar Jan 26 '18 14:01 Leif-Frederiksen