Reproduction
Older func runtimes emitted this code when a constructor had parameters but TypeScript did not emit decorator metadata:
src/app.module.ts
import { Command, FuncModule, Handler, run } from 'func'
class ProjectService {}
@Command({ name: 'inspect' })
class InspectCommand {
constructor(private project: ProjectService) {}
@Handler()
run() {}
}
@FuncModule({ commands: [InspectCommand] })
class AppModule {}
run(AppModule)What this error means
Dependency injection relies on runtime parameter metadata. The JavaScript output did not contain enough information to identify the requested service. Current func versions keep this code for compatibility with older releases.
How to fix it
Enable both decorator options in the TypeScript configuration used by the build:
tsconfig.json
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true
}
}Ensure the class has a func decorator, register injected services in FuncModule.services, and confirm that funcgo is reading the intended tsconfig.json.