Skip to main content
If you need support for the emitDecoratorMetadata typescript compiler option, import the emitDecoratorMetadata build extension and use it in your trigger.config.ts file:
This is usually required if you are using certain ORMs, like TypeORM, that require this option to be enabled. It’s not enabled by default because there is a performance cost to enabling it.
emitDecoratorMetadata hooks into the esbuild bundle process and uses the TypeScript compiler API to compile files containing decorators. Enable emitDecoratorMetadata in your tsconfig.json and install typescript in your devDependencies.

Using with TypeScript 7

TypeScript 7 does not expose the JavaScript compiler API required by this extension. Install the TypeScript 6 compatibility package alongside TypeScript 7:
Your project continues using TypeScript 7 for its normal type checking and compiler commands. The extension loads the compatibility package only when it needs to emit decorator metadata. Restart the Trigger.dev dev server after installing the package.