Provisioning the modern site along with custom SPFx webpart using CSOM is not working

Copper Contributor

We have created a tool to provision communication sites on demand. We also have a source site created manually and added custom web parts (SPFx web parts).

When the tool executes GetProvisioningTemplate, the XML has the information of all the custom web parts under section ClientSitePages. But when the tool executes ApplyProvisioningTemplate the code fails at the time of applying ClientSitePages with an error "Value cannot be null. 
Parameter name: source "

Started applying the template 
February 06, 2018 18:48:19, 018 [1] INFO SiteProvisioningUtility.Program - 1|9-Regional Settings 
February 06, 2018 18:48:19, 353 [1] INFO SiteProvisioningUtility.Program - 2|9-Site Security 
February 06, 2018 18:48:21, 557 [1] INFO SiteProvisioningUtility.Program - 3|9-Features 
February 06, 2018 18:48:26, 842 [1] INFO SiteProvisioningUtility.Program - 4|9-List instances 
February 06, 2018 18:54:45, 278 [1] INFO SiteProvisioningUtility.Program - 5|9-Tenant Settings 
February 06, 2018 18:54:45, 294 [1] INFO SiteProvisioningUtility.Program - 6|9-Application Lifecycle Management 
February 06, 2018 18:54:56, 309 [1] INFO SiteProvisioningUtility.Program - 7|9-ClientSidePages 
February 06, 2018 18:55:01, 356 [1] ERROR SiteProvisioningUtility.Program - Error occurred while applying the template :System.ArgumentNullException: Value cannot be null. 
Parameter name: source 
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source) 
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectClientSidePages.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation) 
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo) 
at Microsoft.SharePoint.Client.WebExtensions.ApplyProvisioningTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation applyingInformation)

0 Replies