Skip to content

transformer: Collision in lowered accessors with legacy decorators for _prop and prop #20946

@filimon-danopoulos-stratsys

Description

Thanks for the great tool and quick response in #20133.

I am adopting Vite 8 now and found an issue, the following code:

export class Foo {
  @property()
  accessor prop!: string;

  @property()
  accessor _prop!: string;
}

Produces an output where the same backing field is used for both prop and _prop. In turn this leads to a runtime error

TypeError: Cannot initialize the same private elements twice on an object

See a reproduction of the exact circumstances here

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-transformerArea - Transformer / Transpiler

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions