sharepoint online – PowerShell PnP does not contain a method named ‘SetUseAccessRequestDefaultAndUpdate’

Any thoughts on why this line has started failing (I’ve uninstalled and re-installed PnP):

Getting error message:
Method invocation failed because (Microsoft.SharePoint.Client.Web) does not contain a method named ‘SetUseAccessRequestDefaultAndUpdate’.

We’ve been using this script for several months now, and it’s started failing.

Enable access requests to the owner group of the site using PnP PowerShell:
To set access requests to the site owners, use:

#Set Variables 
$SiteURL = "" 
#Connect to PNP Online 
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) 

#Get the Web 
$Web = Get-PnPWeb 

#Enable Access Request for the site to the Owners Group 

#Read more: