SharePoint / SharePoint/sp-dev-docs
Site Designs - addContentTypesFromHub prevents API from working
@Ashlesha-MSFT is already working on this.
Since May 7, 2025.
- 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
- Setup a Content Type in your contenttype-hub
- 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
]
}
]
}
- Run the site design from the UI and validate that the content-type is available
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.