Skip to content

Problem with target field -- incorrect tsconfig usage #236

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

Closed
swelet opened this issue Jul 28, 2020 · 3 comments
Closed

Problem with target field -- incorrect tsconfig usage #236

swelet opened this issue Jul 28, 2020 · 3 comments
Labels
kind: support Asking for support with something or a specific use case problem: needs more info This issue needs more information in order to handle it problem: removed issue template OP removed the issue template without good cause problem: stale Issue has not been responded to in some time solution: can't repro An attempt to reproduce has been tried and failed solution: invalid This doesn't seem right

Comments

@swelet
Copy link

swelet commented Jul 28, 2020

I'm having the same problem as @yangwao #217 (comment)_ with the target field. I'm trying to write a class with a "get" accessor, and the compiler is giving me

semantic error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.

Screenshot 2020-07-28 at 12 37 58

eventhough target is allready es5.

Screenshot 2020-07-28 at 12 38 59

@ezolenko
Copy link
Owner

ezolenko commented Aug 7, 2020

Works for me if I set target to es5 and use this code in a random class:

    private _name : string = '[Animal]';
    get name():string{
        return this._name;
    }

    set name(name:string){
        this._name = name;
    }

@ezolenko
Copy link
Owner

ezolenko commented Aug 7, 2020

Could you add verbose output? Part of it is a dump of parsed tsconfig.

@ezolenko ezolenko added the problem: needs more info This issue needs more information in order to handle it label Oct 16, 2020
@agilgur5 agilgur5 added problem: stale Issue has not been responded to in some time solution: invalid This doesn't seem right labels Apr 23, 2022
@agilgur5 agilgur5 changed the title Problem with target field Problem with target field -- incorrect tsconfig usage Apr 23, 2022
@agilgur5 agilgur5 added the solution: can't repro An attempt to reproduce has been tried and failed label Apr 23, 2022
@agilgur5
Copy link
Collaborator

agilgur5 commented Apr 23, 2022

OP seemed to have this as part of their Rollup config (as a screenshot instead of text unfortunately):

 typescript({
  lib: ["es5", "es6", "es7", "dom"],
  target: "es5",
  declaration: true
})

While it's difficult to tell without a full rollup.config.js or a full tsconfig.json (and OP did not respond to requests for more information), that seems like incorrect usage of rpt2 to me.
rpt2 doesn't support those fields, those are fields of tsconfig.json's compilerOptions. Can see rpt2's list of options in the docs here

@agilgur5 agilgur5 added problem: removed issue template OP removed the issue template without good cause kind: support Asking for support with something or a specific use case labels Apr 29, 2022
Repository owner locked as resolved and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: support Asking for support with something or a specific use case problem: needs more info This issue needs more information in order to handle it problem: removed issue template OP removed the issue template without good cause problem: stale Issue has not been responded to in some time solution: can't repro An attempt to reproduce has been tried and failed solution: invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants