SharePoint / SharePoint/sp-dev-docs

Site Designs - addContentTypesFromHub prevents API from working

Open
#10,236 2 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since May 7, 2025.

sharepoint-developer-support type:bug-confirmed type:bug-suspected
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint CSOM

Developer environment

None

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details

The issue is persistent across both the REST endpoint, and CSOM

Describe the bug / error

When [addContentTypesFromHub] is present in a Site Script the site design will fail to run, it'll not return an error, just simply zero results.

When running the site-design via the UI it works fine, however running it via the API (REST or CSOM) it'll return no updates

This was first reported on Tech Community 1½ years ago

Steps to reproduce
  1. Setup a Content Type in your contenttype-hub
  2. Setup a Site Script/design
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
  "actions": [
    {
      "verb": "addContentTypesFromHub",
      "ids": [
        "0x01010093E4CD8A599EE14C833C8B64942F2F3C" //content type id
      ]
    }
  ]
}
  1. Run the site design from the UI and validate that the content-type is available
  2. Run the site design via code, the easiest way is using PnP.PowerShell invoke-PnPSiteDesign -Identity "Site design Id" - and observe nothing happening
Expected behavior

I would expect there to be no difference between running a site design via code or via the GUI

Right now a workaround is to add the content-type via Graph this however prevents the site-design from functioning without my code running first, which breaks with the idea of site designs unfortunately


NOTE This is a "reopen" of an existing issue #9415

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.