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

Can't use accessors according to VSCode -- templates have no target #1045

Open
adriano-di-giovanni opened this issue Jun 11, 2021 · 2 comments
Labels
kind: support Asking for support with something or a specific use case scope: integration Related to an integration, not necessarily to core (but could influence core) scope: templates Related to an init template, not necessarily to core (but could influence core)

Comments

@adriano-di-giovanni
Copy link

Current Behavior

Can't use accessors in a project created with the latest version of tsdx. It seems to be an editor integration issue because the code compiles.

image

You should be able to reproduce the issue easily by creating a class such as

export class Entity {
  get name() {
    return 'Entity'
  }
}

Your environment

  System:
    OS: macOS 11.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 19.36 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.5 - ~/.nvm/versions/node/v14.15.5/bin/node
    npm: 6.14.11 - ~/.nvm/versions/node/v14.15.5/bin/npm
  Browsers:
    Chrome: 91.0.4472.101
    Firefox: 70.0.1
    Safari: 14.0.2
  npmPackages:
    tsdx: ^0.14.1 => 0.14.1
    typescript: ^4.3.2 => 4.3.2

Here is the VS Code info

Version: 1.57.0
Commit: b4c1bd0a9b03c749ea011b06c6d2676c8091a70c
Date: 2021-06-09T17:22:31.215Z
Electron: 12.0.9
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 20.2.0
@orest22
Copy link

orest22 commented Jun 23, 2021

@adriano-di-giovanni Hey, make sure your VSCode uses workspace typescript.

Screen Shot 2021-06-23 at 2 48 42 PM

@agilgur5 agilgur5 added kind: support Asking for support with something or a specific use case scope: integration Related to an integration, not necessarily to core (but could influence core) scope: templates Related to an init template, not necessarily to core (but could influence core) labels Apr 11, 2022
@agilgur5 agilgur5 changed the title Can't use accessors according to VSCode Can't use accessors according to VSCode -- templates have no target Apr 11, 2022
@agilgur5
Copy link
Collaborator

Per the error, that would be because your tsconfig.json's target setting isn't ES5 or above.

That might be because you used the templates, which don't have a target setting since #466 as it is overwritten by TSDX. target's default when unset is still ES3 per the above link.

You can set it to ESNext to reflect TSDX's setting, but keep in mind that is not actually used by TSDX. That might be a new error from the VSCode TS integration as I haven't seen it before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: support Asking for support with something or a specific use case scope: integration Related to an integration, not necessarily to core (but could influence core) scope: templates Related to an init template, not necessarily to core (but could influence core)
Projects
None yet
Development

No branches or pull requests

3 participants