serverless-plugin-typescript icon indicating copy to clipboard operation
serverless-plugin-typescript copied to clipboard

Multi-language Support

Open jgreen01su opened this issue 6 years ago • 2 comments

I want to setup a multi-language API while using this plugin to allow me to use TypeScript.

Example

functions:
  hello:
    runtime: nodejs10.x
    handler: hello.world # hello.ts
  webapi:
    runtime: python3.8
    handler: webapi # webapi.py

Issue When I add handlers written in other languages I receive the following error.

Serverless: Using local tsconfig.json
{
  file: undefined,
  start: undefined,
  length: undefined,
  messageText: "File 'webapi.ts' not found.",
  category: 1,
  code: 6053,
  reportsUnnecessary: undefined
}
 
  Type Error ---------------------------------------------
 
  Cannot read property 'getLineAndCharacterOfPosition' of undefined
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     OS:                     darwin
     Node Version:           12.6.0
     Serverless Version:     1.47.0

It seems like this plugin tries to transpile all handlers as if they were in ts files regardless of the selected runtime.

Is there a workaround for this?

jgreen01su avatar Jul 16 '19 19:07 jgreen01su

@JackCuthbert Where in the codebase would one need to change?

jgreen01su avatar Oct 21 '19 21:10 jgreen01su

Same problem happens to me mixing go1.x with nodejs16.x i've got cannot locate handler - not found

i'am using: "serverless": "3.21.0", "serverless-plugin-typescript": "^2.1.2"

image

luchopcerra avatar Sep 12 '22 19:09 luchopcerra