aws-toolkit-jetbrains icon indicating copy to clipboard operation
aws-toolkit-jetbrains copied to clipboard

Typescript project getting `Cannot find handler` for local debug configuration

Open flexelem opened this issue 4 years ago • 4 comments

Describe the bug

I am able configure and debug my Java lambdas successfully, however, I am not able to debug my lambdas written in typescript. When I try to create a debug configuration I get Cannot find handler 'src/lambda/hello-world.handler' in project

To reproduce

  1. Create a new javascript project with npm init
  2. Create sub directory with mkdir -R src/lambda
  3. Create a hello world example file with name hello-world.ts under src/lambda.

A sample code for an REST API;

import { APIGatewayProxyEventV2, APIGatewayProxyHandlerV2, APIGatewayProxyResultV2 } from 'aws-lambda';

export const handler: APIGatewayProxyHandlerV2 = async (event: APIGatewayProxyEventV2) : Promise<APIGatewayProxyResultV2> => {
    console.log(event);
    return {
        statusCode: 200,
    };
};

Expected behavior

Create debug configuration for typescript handler.

Screenshots

project-directory error

Your Environment

  • OS: macOS Catalina
  • JetBrains product: WebStorm
  • JetBrains product version: 2020.2
  • AWS Toolkit version: 1.25-202
  • SAM CLI version: 1.21.1
  • JVM/Python version: 1.8.0_261

Additional context

flexelem avatar Mar 17 '21 15:03 flexelem

Hi Burak,

We do not have TypeScript support enabled yet (it's in a feature branch currently).

abrooksv avatar Mar 17 '21 16:03 abrooksv

Hi Austin,

That is sad :(. Thanks a lot for informing though. Great product!

flexelem avatar Mar 17 '21 16:03 flexelem

Feature branch is: https://github.com/aws/aws-toolkit-jetbrains/tree/feature/typescript

abrooksv avatar Mar 17 '21 20:03 abrooksv

Hi there,

I am reopening this to learn if typescript is supported. Thanks!

Best, Burak

flexelem avatar Jul 22 '22 14:07 flexelem

it would really be great if typescript was supported. any news?