voidzero-dev / voidzero-dev/vite-plus

Auto-accessor syntax is not transpiled

Open
#1,556 1 comment 0 reactions 1 assignee Claimed by @naokihaba View on GitHub
pending triage
Dominant language
Rust
Stars
5.8k
Forks
261
Avg merge
1d 34m
Merged PRs (30d)
135

Description

### Describe the bug

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

```ts
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
```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

```shell
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

```shell

```

### Validations

- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Check that there isn't [already an issue](https://github.com/voidzero-dev/vite-plus/issues) for the same bug.
- [x] Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.