I just tested the new setBannerImage method. The method works fine for replacing the banner image of a page that already a different image set as the banner image. However, for a newly created page or a page that does not have an initial banner image set the method gives the error message: TypeError: Cannot convert undefined or null to object
I think this might be because we are deleting the below properties in bannerImageUrl method that are undefined initially before a banner image is set:
delete this._layoutPart.properties.webId;
delete this._layoutPart.properties.siteId;
delete this._layoutPart.properties.listId;
delete this._layoutPart.properties.uniqueId;
_Originally posted by @aakashbhardwaj619 in https://github.com/pnp/pnpjs/issues/547#issuecomment-475877421_
OK, thanks will have a look.
Fixed this, turns out the guids in the layouts webparts section are constants, not generated as we had first assumed when we reverse engineering the API. Fix will be in #581 and part of 1.3.2 release. Thanks!