Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for Typescript syntax? #197

Closed
jamesliupenn opened this issue Mar 10, 2020 · 1 comment
Closed

No support for Typescript syntax? #197

jamesliupenn opened this issue Mar 10, 2020 · 1 comment

Comments

@jamesliupenn
Copy link

I am attempting to run lambda-local via the CLI and I'm running into these Unexpected token errors. The only thing I'm doing differently is that my Lambda is written in Typescript.

This is what I'm executing:

lambda-local -l src/lambdas/index.ts -h graphql -e src/lambdas/event_s3.ts

index.ts is simply a 3 liner index file:

import { GraphQLHandler } from "./graphql";  <--- This is where my handler is being created
export * from "./graphql";
export const graphql = GraphQLHandler;

What am I doing wrong here? The stacktrace looks to be erroring out on the {} around GraphQLHandler

@jamesliupenn jamesliupenn changed the title No support on Typescript syntax? No support for Typescript syntax? Mar 10, 2020
@gpotter2
Copy link
Collaborator

gpotter2 commented Mar 10, 2020

You have to transpile your typescripts files into javascript first before using lambda-local.
that's always in the case in typescript.
See https://stackoverflow.com/a/54410381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants