-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting property overridden error for dataVersion() #6267
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Seeing this for me as well after upgrading VS Code to August 2020 (v 1.49) |
I can get rid of this error by changing the Typescript version in VSCode in use for the project workspace(v3.3), instead of using VSCode's default 4.0.2 (introduced in VSCode August 2020 release). |
So to fix it we just need to set the ts version to what the spfx ts version is, which is v3.3? |
Yes. |
Good thing all of those are Microsoft owned lol |
This isn't really a SPFx issue... just two versions of TypeScript conflict. The solution above by @stchiew would be the best approach. |
Using TS 4.X in VSCode provides a better authoring experience... I'm opting to ignore the IDE errors re 'overridden as an accessor' since they are not compile errors. That said, moving these accessor overrides into the constructor like so may be a workaround if the warnings really bother you (not tested): constructor() {
super();
Object.defineProperty(this, "dataVersion", {
get() {
return Version.parse('1.0');
}
});
}
// protected get dataVersion(): Version {
// return Version.parse('1.0');
// } |
Closing this issue as "answered". If you encounter a similar issue(s), please open up a new issue. See our wiki for more details: Issue-List: Our approach to closed issues |
Category
Describe the bug
I get this error
https://imgur.com/qv6u8Jh
Steps to reproduce
Load the basic React tutorial template, no more changes needed
Expected behavior
No error
Environment details (development & target environment)
Windows 10
SharePoint Online
Node.js v10
Chrome v79
VS Code | SPFx v1.10.0
The text was updated successfully, but these errors were encountered: