---
title: Fix Vite 8 Oxc Not Lowering Native Decorators
description: Fix Vite 8's Oxc transformer not lowering native class decorators. Understand the limitation and the real workaround for older build targets.
date: 2026-08-05T00:00:00.000Z
category: guides-fixes
tags: vite, oxc, typescript, bug-fix
---

## Quick Answer

Vite 8 replaces esbuild with Oxc for JavaScript transformation, and Oxc's transformer doesn't support lowering native decorators, the exact words from Vite's own migration guide. A build target that needed decorators downlevel-compiled to older JS now fails or ships unsupported syntax. If you don't need native decorator semantics specifically, switching to TypeScript's `experimentalDecorators` avoids the limitation entirely.

## Why Oxc can't lower this syntax

Vite 8's [migration guide](https://vite.dev/guide/migration) states the limitation directly, under the section on replacing esbuild with Oxc for JavaScript transformation: "The Oxc transformer does not support lowering native decorators."

"Lowering" means downlevel-compiling newer syntax into older, broadly-supported JavaScript for a build target that doesn't understand it natively, the same job esbuild used to do for decorators alongside everything else it transformed. Oxc, Vite 8's replacement for that transform step, doesn't implement this specific lowering pass.

This is easy to conflate with a different, much older feature: TypeScript's `experimentalDecorators`, the decorator implementation most real-world projects (Angular-style DI containers, some ORMs, class-based state management) have used for years. That's a separate TypeScript-level transform, unaffected by this Oxc gap. It keeps working the same as it always has. The limitation is specifically about TC39's newer native decorator proposal, a related but distinct syntax that TypeScript can also emit when `experimentalDecorators` is off.

## Fix it: use the transform that already works

### Before: native decorators targeting an older environment

```json title="tsconfig.json"
{
  "compilerOptions": {
    "target": "ES2020"
    // no experimentalDecorators — TypeScript emits native
    // decorator syntax, which Oxc can't lower for ES2020 (BROKEN)
  }
}
```

### After: TypeScript's legacy decorator transform

```json title="tsconfig.json"
{
  "compilerOptions": {
    "target": "ES2020",
    "experimentalDecorators": true, // FIXED: TypeScript itself lowers
    "emitDecoratorMetadata": true // this transform, not Oxc
  }
}
```

`experimentalDecorators` changes which decorator semantics your code actually gets, not just how it's compiled. This is a real behavior difference, not a drop-in syntax swap, so check the library or framework you're using decorators for to confirm which mode it expects before flipping this setting.

<Callout
  type="warning"
  title="If you specifically need native decorator semantics"
>
  Switching to `experimentalDecorators` isn't an option if a dependency requires
  the real TC39 native decorator behavior. In that case, either target a
  JavaScript environment new enough to run native decorators without lowering at
  all, or pre-transform those files with a separate tool (Babel or SWC both
  support native decorator lowering) before Vite processes them.
</Callout>

## Confirmed version range

Documented in Vite's own current migration guide as a known limitation of Oxc's transformer in Vite 8, with no committed fix timeline. This site's own TypeScript config doesn't use class decorators in any form, so this limitation wasn't independently reproducible against this repo's own build. The distinction between native and `experimentalDecorators` syntax is the same regardless of which project hits it. Browse more posts like this in the [Guides & Fixes](/guides-fixes) archive.
