Skip to content
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

Closed
1 task done
TheInvoker opened this issue Sep 11, 2020 · 9 comments
Closed
1 task done

Getting property overridden error for dataVersion() #6267

TheInvoker opened this issue Sep 11, 2020 · 9 comments
Labels
area:tooling Category: Development tooling status:answered Answer to a question. type:question Question... if answered, will be tagged as such.

Comments

@TheInvoker
Copy link

Category

  • Bug

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

@msft-github-bot
Copy link
Collaborator

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@msft-github-bot msft-github-bot added the Needs: Triage 🔍 Awaiting categorization and initial review. label Sep 11, 2020
@stchiew
Copy link

stchiew commented Sep 11, 2020

Seeing this for me as well after upgrading VS Code to August 2020 (v 1.49)

@stchiew
Copy link

stchiew commented Sep 11, 2020

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).
You can change the typescript version at the bottom right of the editor sceeen - click on the version number next to Typescript, then at the top of the editor screen select your workspace's typescript version.

@TheInvoker
Copy link
Author

So to fix it we just need to set the ts version to what the spfx ts version is, which is v3.3?

@stchiew
Copy link

stchiew commented Sep 11, 2020

So to fix it we just need to set the ts version to what the spfx ts version is, which is v3.3?

Yes.
The bigger question will be:
Is this an SPFX issue, Typescript 4 issue or VSCode intellisense issue.

@TheInvoker
Copy link
Author

Good thing all of those are Microsoft owned lol

@andrewconnell
Copy link
Collaborator

This isn't really a SPFx issue... just two versions of TypeScript conflict. The solution above by @stchiew would be the best approach.

@andrewconnell andrewconnell added area:tooling Category: Development tooling status:answered Answer to a question. type:question Question... if answered, will be tagged as such. and removed Needs: Triage 🔍 Awaiting categorization and initial review. labels Sep 16, 2020
@deanbot
Copy link
Contributor

deanbot commented Sep 18, 2020

Using TS 4.X in VSCode provides a better authoring experience...

image

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');
  // }

@ghost
Copy link

ghost commented Sep 21, 2020

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

@ghost ghost closed this as completed Sep 21, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Sep 21, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:tooling Category: Development tooling status:answered Answer to a question. type:question Question... if answered, will be tagged as such.
Projects
None yet
Development

No branches or pull requests

5 participants