pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
985 stars 665 forks source link

[BUG] Add-PnPClientSideWebPart: Object reference not set to an instance of an object #2938

Closed Ganesh-Rajagopal closed 3 years ago

Ganesh-Rajagopal commented 3 years ago

Expected Behavior

Add-PnPClientSideWebPart -Page $page -DefaultWebPartType "List" -Section 1 -Column 1 -Order 1

Add-PnPClientSideWebPart -Page $page -DefaultWebPartType "List" -Section 1 -Column 1 -WebPartProperties @{isDocumentLibrary="false";selectedListId="55e6a7eb-6e15-4fb5-bebd-2e8bb4cd60ae";selectedViewId="47e6a7eb-6e15-4fb5-bebd-4e7bb2cd60rt";webpartHeightKey=4}

The above 2 commands will create "List" Client-Side Web Part to a modern Page The above command was working till last week 25/Sep/2020 Friday without any issues. Can someone please provide light on this. Please.

Actual Behavior Getting below error Add-PnPClientSideWebPart : Value cannot be null. Parameter name: Passed control cannot be null At D:\SPO\CreateModernPage.ps1:71 char:5

Add-PnPClientSideWebPart: Object reference not set to an instance of an object. At D:\SPO\CreateModernPage.ps1:76 char:5

Steps to reproduce behavior

$SiteURL = "https://testtenant.sharepoint.com/sites/Test1" $connOpen = Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) $pagename = "HomeTest6"

$page = Add-PnPClientSidePage -Name $pagename -LayoutType Home -Publish Add-PnPClientSidePageSection -Page $page -SectionTemplate OneColumn -Order 2

Add-PnPClientSideWebPart -Page $page -DefaultWebPartType "List" -Section 1 -Column 1 -Order 1 $page.Save() $page.Publish()

Add-PnPClientSideWebPart -Page $page -DefaultWebPartType "List" -Section 1 -Column 1 -WebPartProperties @{isDocumentLibrary="false";selectedListId="55e6a7eb-6e15-4fb5-bebd-2e8bb4cd60ae";selectedListUrl="/sites/Test1/Lists/testlist";webRelativeListUrl="/Lists/testlist";webpartHeightKey=4}

$page.Save() $page.Publish()

Please help on this

Ganesh-Rajagopal commented 3 years ago

Client Web Part Issue

jansenbe commented 3 years ago

The root cause of the problem has been found and a fix is rolling out soon.

jansenbe commented 3 years ago

Think we can close, there's many independent confirmations the issue is fixed