Changelog - 2026-10-16
Restate the decorator options in your own tsconfig
Bug FixIn one line. Bun ignores "extends": "@venizia/dev-configs/tsconfig.common.json", so every tsconfig.json that Bun runs must restate two options itself.
json
{
"extends": "@venizia/dev-configs/tsconfig.common.json",
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false
}
}What changed
- Bun 1.4.2 skips an
extendsthat names a package, even one level deep (tsconfig.common.jsonandtsconfig.base.jsonalike). Bun then compiles TC39 decorators:@injecton a constructor parameter is dropped with no error, and class fields get define semantics instead of the assign semantics of thetscbuild. - The trap is silent.
tscfollows the whole chain, so typecheck and build stay green. Onlybun runandbun testdiverge. - Restating the options in your own
tsconfig.jsongives legacy decorators, which is right.
Who is affected
- An application or package that Bun runs and whose
tsconfig.jsononly extends dev-configs. Add"experimentalDecorators": trueand"useDefineForClassFields": falseto itscompilerOptions. - A project that already restates
experimentalDecorators. AdduseDefineForClassFields: falseso its tests run the class-field semantics it ships.
Details
Restate emitDecoratorMetadata only if your code reads design:* metadata. Under Bun it turns an interface-typed constructor parameter into a runtime import that fails with Export named 'X' not found, so import such names with import type. tsc --noEmit --isolatedModules reports most of them as TS1272; loading each package's src/index.ts under Bun finds the rest.