'dataVersion' is defined as a property | Gustavo Velez |
Working with SharePoint Framework (SPFx) WebParts, you can get the error "'dataVersion' is defined as a property" in the scaffolded .ts WebPart file | 20-12-2020 |
SharePoint | |
When the SPFx scaffolded .ts WebPart file is created, an error can be found immediately in the code line protected get dataVersion(): Version {: The error description is: "'dataVersion' is defined as a property in class 'BaseClientSideWebPart{I[Name]WebPartProps}', but is overridden here in '[Name]WebPart' as an accessor." Although the error is not serious and the WebPart compiles and works without any problem, it is extremely annoying. And it is also very simple to solve the problem: add a code line at the top of the 'dataVersion' line indicating: // @ts-ignore The error will be gone... |