“Invalid web part properties” – Incorrect or missing properties in a web part configuration.

Loading

The “Invalid Web Part Properties” error in SharePoint occurs when a web part has incorrect, missing, or corrupted properties in its configuration. This issue can cause the web part to fail to render, display errors, or break the page layout. Below is a detailed troubleshooting and resolution guide.


1. Understand the Error Message

When a web part has invalid properties, you may encounter errors such as:

  • “Web Part cannot be displayed”
  • “Invalid Web Part Properties”
  • “An unexpected error has occurred”
  • “Web Part Maintenance Page” recommendation

Where to Check for Errors?

  • On the SharePoint Page:
    • If the error occurs, try editing the page in Edit Mode.
  • Using Developer Console (F12 in Browser):
    • Open Google Chrome or Microsoft Edge.
    • Press F12 and go to the Console tab to check for JavaScript errors.
  • In SharePoint Logs (ULS Logs) (For On-Premises):
    • If a Correlation ID is displayed, retrieve logs using PowerShell: Get-SPLogEvent | Where-Object {$_.Correlation -eq "<your-correlation-id>"} | Format-List
  • Event Viewer Logs (For On-Premises):
    • Open Event Viewer (eventvwr.msc).
    • Check logs under Windows Logs > Application.

2. Use the Web Part Maintenance Page

If the page is completely broken due to a web part issue, you may need to remove or reset the web part using the Web Part Maintenance Page.

How to Open the Web Part Maintenance Page

  1. Append the following to your page URL: ?contents=1 Example: https://yourdomain.sharepoint.com/sites/YourSite/SitePages/YourPage.aspx?contents=1
  2. Press Enter, and it will display all web parts on the page.
  3. Select the problematic web part and click Delete or Reset.

3. Check Web Part Properties in SharePoint UI

  1. Edit the SharePoint page.
  2. Click on the web part gear icon or Edit Web Part.
  3. Check if all required properties are correctly configured.
  4. If needed, reset the web part settings to default.

4. Validate Web Part Properties in SharePoint Online (SPFx)

If using SharePoint Framework (SPFx) web parts, incorrect property configurations in the manifest.json or WebPart.ts file can cause errors.

How to Fix in SPFx Web Part Code

  1. Check Property Pane Settings (WebPart.ts): protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: "Web Part Settings" }, groups: [ { groupName: "Settings", groupFields: [ PropertyPaneTextField('title', { label: "Title", value: "My Web Part" }), PropertyPaneToggle('enableFeature', { label: "Enable Feature" }) ] } ] } ] }; }
  2. Ensure Properties are Defined in manifest.json:
    • Open config\config.json and validate web part properties.
    • Example: { "preconfiguredEntries": [ { "title": "My Web Part", "description": "A custom web part", "properties": { "title": "Default Title", "enableFeature": true } } ] }
  3. Deploy and Test the Web Part: gulp bundle --ship gulp package-solution --ship

5. Fix Classic (Server-Side) Web Part Properties

For classic SharePoint server-side web parts, incorrect properties in the web part XML definition can cause issues.

How to Fix in Web Part XML

  1. Locate the Web Part Definition File (.webpart).
  2. Open the file and check for missing or incorrect properties: <WebPart xmlns="http://schemas.microsoft.com/WebPart/v3"> <Title>Custom Web Part</Title> <Description>My Web Part</Description> <Properties> <Property Name="Title" Type="string">My Web Part</Property> <Property Name="EnableFeature" Type="bool">true</Property> </Properties> </WebPart>
  3. Ensure that all required properties exist and are correctly formatted.
  4. Redeploy the updated .webpart file.

6. Fix Web Part Properties Using PowerShell

If the web part cannot be modified via UI, use PowerShell.

List Web Parts on a Page

$web = Get-SPWeb "http://YourSiteURL"
$page = $web.GetFile("Pages/YourPage.aspx")
$webParts = $web.GetLimitedWebPartManager($page.ServerRelativeUrl, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
$webParts.WebParts | Select Title, ID

Modify a Web Part’s Properties

$webPart = $webParts.WebParts | Where-Object {$_.Title -eq "Your Web Part Title"}
$webPart.Title = "New Title"
$webParts.SaveChanges($webPart)
$web.Dispose()

Delete a Corrupt Web Part

$webParts.DeleteWebPart($webPart)
$web.Update()

7. Reset and Re-add the Web Part

If the issue persists:

  1. Delete the Web Part.
  2. Re-add it from the Web Part Gallery.
  3. Reconfigure its properties manually.

8. Restart Services and Clear Cache

If web parts continue to fail, restart SharePoint services and clear cache.

Restart IIS

iisreset

Restart SharePoint Timer Service

Restart-Service SPTimerV4

Clear SharePoint Configuration Cache (For On-Premises)

  1. Stop the SharePoint Timer Service (SPTimerV4).
  2. Navigate to: C:\ProgramData\Microsoft\SharePoint\Config\GUID-folder\
  3. Delete all XML files except cache.ini.
  4. Open cache.ini, change the value to 1, and save.
  5. Restart the SharePoint Timer Service.

9. Contact Microsoft Support

If none of the solutions work:

  • Open a Microsoft Support Ticket via Microsoft 365 Admin Center.
  • Provide the ULS log Correlation ID, error messages, and web part configuration details.

Leave a Reply

Your email address will not be published. Required fields are marked *