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

Compiler incorrectly errors depending on the order to api decorators #1113

Closed
pmdartus opened this issue Mar 15, 2019 · 1 comment
Closed
Labels

Comments

@pmdartus
Copy link
Member

Description

In some specific cases, the LWC compiler throws when applying an api decorators to getter/setters.

import { LightningElement, api } from 'lwc';

export default class Test extends LightningElement {
    @api
    get two() {}
    set two(value) {}

    get three() {}
    @api
    set three(value) {}
   //  ^ LWC1112: @api get three and @api set three detected in class declaration. Only one of the two needs to be decorated with @api.
}

This bug appears to be related to the application order to the api decorator. In the above code snippet, moving the api decorator right before the getter definition make the compiler pass.

Version

  • LWC: 0.37.0
@AllanOricil
Copy link
Contributor

Regression? #2406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants