Skip to content

Auto-accessor syntax is not transpiled #1556

Open

Description

@OldStarchy

Describe the bug

I created a new project with vp create using all the defaults

class Foo {
  accessor x = 3;
}

does not transpile properly causing an "Unexpected identifier 'x'" error in the browser.

I've tried various target="es2025" (and older) configs in both tsconfig, vite.config.ts build target, and build.rolldown.transform.target etc. and have been unable to get this to transpile properly.

Note, that in the tsgo playground, setting the target in tsconfig is enough to work.
https://tsgo.sxzz.dev/#eNplkEFrwzAMhf+K0bmU0bFLxm5jsMHYD4h7MI5SPBwrSEpXCPnvk1NSCj0Z63vvoacZemjaFoaQyl4FdhBzEHEfRG727ItzIUYUIXYX9+aeX+twgeOuBZVIpU+n/a9QMedc1R4iDWPKyD+jJiriobEkI5Vp4BNqHXlAOTwdXjzsNjhQN2XcYMGLCW9QlFNcncoT3sYo36vrsygyjQ+cJn1PfM3sktwndmhVOdQlH2yMQvmMX1bsmr8pqmBZD3C0U0ED1vtsTw6Kovb5g6YPWXD5BwufbjM=

Reproduction

just use vp create

Steps to reproduce

  1. run vp create using all the defaults
  2. add the following snippet to main.ts
    class Foo {
    	accessor x = 2;
    }
  3. vp dev to start the server
  4. open in browser and observe the error Uncaught SyntaxError: Unexpected identifier 'x' (at main.ts?t=1778551827935:7:11)

System Info

VITE+ - The Unified Toolchain for the Web

Environment:
  Version       24.15.0
  Source        engines.node
  Source Path   /home/sorokin/projects/test/package.json
  Project Root  /home/sorokin/projects/test

Tool Paths:
  node  /home/sorokin/.vite-plus/js_runtime/node/24.15.0/bin/node
  npm   /home/sorokin/.vite-plus/js_runtime/node/24.15.0/bin/npm
  npx   /home/sorokin/.vite-plus/js_runtime/node/24.15.0/bin/npx





VITE+ - The Unified Toolchain for the Web

vp v0.1.20

Local vite-plus:
  vite-plus  v0.1.20

Tools:
  vite             v8.0.10
  rolldown         v1.0.0-rc.17
  vitest           v4.1.5
  oxfmt            v0.46.0
  oxlint           v1.61.0
  oxlint-tsgolint  v0.22.0
  tsdown           v0.21.10

Environment:
  Package manager  pnpm v11.1.0
  Node.js          v24.15.0 (engines.node)

Used Package Manager

pnpm

Logs

Validations

Activity

  1. added theissue type on May 12, 2026
  2. naokihaba commented on May 12, 2026

    @naokihaba
    Collaborator

    I've set up a reproduction environment at the link below.
    https://github.com/naokihaba/vite-plus-repro-1556

    cc @fengmk2. Please let me know if I've misunderstood anything.

    As I understand it, while the TC39 decorators proposal including Auto-Accessors is at Stage 3, it's still being fine-tuned. Because the specs aren't fully locked down yet, work is still ongoing for the test262 standard test suite as well.

    The Oxc team has decided to hold off on implementing decorators for now because the cost of keeping up with constant changes is so high and they want to avoid ecosystem fragmentation. This seems to be why the accessor keyword is passing through to the browser without being transpiled, which leads to a SyntaxError.

  3. self-assigned this
    on May 29, 2026
  4. added this to the Beta milestone on Jun 2, 2026
  5. removed this from the Beta milestone on Jun 21, 2026
  6. added this to the RC milestone on Jul 24, 2026
  7. removed this from the RC milestone on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions