Stack Exchange
aws lambda power tool typescript decorator not working
Adding @logger.injectLambdaContext() in aws-powertools/powertools-lambda-typescript/ to the lambda code causes following error
    error TS1241: Unable to resolve signature of method decorator when called as an expression.
  Argument of type 'TypedPropertyDescriptor<(_event: unknown, _context: unknown) => Promise<void>>' is not assignable to parameter of type 'TypedPropertyDescriptor<SyncHandler<Handler>> | TypedPropertyDescriptor<AsyncHandler<Handler>>'.
    Type 'TypedPropertyDescriptor<(_event: unknown, _context: unknown) => Promise<void>>' is not assignable to type 'TypedPropertyDescriptor<SyncHandler<Handler>>'.
      Types of property 'set' are incompatible.
        Type '((value: (_event: unknown, _context: unknown) => Promise<void>) => void) | undefined' is not assignable to type '((value: SyncHandler<Handler>) => void) | undefined'.
          Type '(value: (_event: unknown, _context: unknown) => Promise<void>) => void' is not assignable to type '(value: SyncHandler<Handler>) => void'.
            Types of parameters 'value' and 'value' are incompatible.
              Target signature provides too few arguments. Expected 3 or more, but got 2.

My code is
    import { LambdaInterface } from "@aws-lambda-powertools/commons";
    import { Logger } from "@aws-lambda-powertools/logger";
    
    const logger = new Logger();
    
    class Lambda implements LambdaInterface {
      // Decorate your handler class method
      @logger.injectLambdaContext({clearState:true})
      public async handler(event: unknown, context: unknown): Promise<void> {
        logger.info("This is an INFO log with some context", { h: event as string, p: context as string });
        return Promise.resolve();
      }
    }

const handlerClass = new Lambda();
export const handler = handlerClass.handler.bind(handlerClass);

tsconfig contains
"compilerOptions": {
    "target": "es2022",
    "experimentalDecorators": true,       
},

I am using typescript version 5.2.2
Reference - https://docs.powertools.aws.dev/lambda/typescript/1.5.1/core/logger/#capturing-lambda-context-info
