Skip to content

vite dev does not transpile standard decorators #20254

Open
@jpzwarte

Description

@jpzwarte

Describe the bug

Given a typescript project with `target: "2022",

    "experimentalDecorators": true,
    "useDefineForClassFields": false,

the default values for the above settings are false and true respectively. This means you can use standard decorators, for example: @property() accessor name: string;.

However, when running vite dev, the @property() code will try to run in the browser, with a syntax error as a result.

Reproduction

Steps to reproduce

No response

System Info

-

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions