Skip to content

Requirements

  • Node.js 22 or newer. Every @kavo/* package declares engines.node: ">=22". Your package manager will warn (or, under engine-strict, refuse) an install on an older release.
  • ESM. Every @kavo/* package ships as ESM only, with no CommonJS entry point. Your app must be ESM too ("type": "module" in its package.json), which the default nest new scaffold is not.
  • Decorator metadata. experimentalDecorators and emitDecoratorMetadata must be on. @Kavo() reads your entity's decorator metadata, and so do TypeORM's columns and Nest's DI.

A tsconfig.json that satisfies all three:

json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "Node16",
    "moduleResolution": "Node16",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "useDefineForClassFields": false,
    "strict": true,
    "skipLibCheck": true
  }
}

useDefineForClassFields: false is load-bearing at ES2022 and above. With it on, TypeScript emits every declared field as a real class field, set to undefined until hydrated. A partially loaded entity then looks fully populated: undefined values leak into responses instead of being absent, and TypeORM's persistence diffing treats them as explicit writes. With it off (what Kavo's own packages and both example apps use), only hydrated fields are set.