Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

[BUG] ClientSidePage.InstantiateDefaultebparts() method throw exception while creating modernpage. #2791

Open
Satyarthsr opened this issue Oct 14, 2020 · 1 comment

Comments

@Satyarthsr
Copy link

Thank you for reporting a bug. 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. If you have a actual question, we would ask you to use SharePoint Developer Group at Microsoft Tech Community. Thanks!

Which PnP repository should you use to report the issue?

Please navigate to the appropriate repository by clicking on the link below and create your issue there. You can delete this section after you have navigated to the correct repository.

Environment

[x ] Office 365 / SharePoint Online
[ ] SharePoint 2016
[ ] SharePoint 2013

If SharePoint on-premises, what's exact CU version:

Expected or Desired Behavior

After creating a clientsidepage I should be able to get Aviailable Webparts to page using ClientSidePage.AvailableClientSideComponents(DefaultClientSideWebparts.Webpartname)

Observed Behavior

The Above statement throws an exception as NullReferenceException: Object Reference not set to an instance of an object.
DETAILS OF Error:
System.AggregateException
HResult=0x80131500
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()
at OfficeDevPnP.Core.Pages.ClientSidePage.AvailableClientSideComponents(String name)
at OfficeDevPnP.Core.Pages.ClientSidePage.AvailableClientSideComponents(DefaultClientSideWebParts webPart)
at Provisioning.ModernPages.Program.Main(String[] args) .This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
NullReferenceException: Object reference not set to an instance of an object.

Steps to Reproduce

If you are reporting a bug please describe the steps to reproduce the bug in sufficient detail to allow testing. Only way to fix things properly, is to have sufficient details to reproduce it. If you are making a suggestion, you can delete this section.

var page=clientcontext.web.AddClientSidePage(xyz.aspx,true);
var component=page.AvailableClientSideComponents(DefaultClientSideWebParts webPart).

@ghost
Copy link

ghost commented Oct 14, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant