Closed kvarela closed 5 years ago
Hello!
For debugging, what I usually do is to go into AWS Lambda console and use the code editor there to find the specific lines in the stack trace, so I can verify exactly the same code that is running. It is usually enough to find the issue, and even try some small fixes in place if you have a development environment.
You can also generate the zip file locally by using sls package
, then unzipping the file from your .serverless
folder. That will also allow you to verify the lines, if you haven't changed the code since.
Anything related to sourcemaps should be configured from within browserify.
With a quick look into https://github.com/browserify/browserify, you can find that adding debug: true
to your browserify config should be enough to add inline sourcemaps. Didn't try it though.
That said, AFAIK Node.js does not natively support sourcemaps. Some package like source-map-support
should help you to enable it.
Also, if you are transpiling code, you usually have to tap into the transpiling tool to get your sourcemaps. If you are using typescript, you can saerch for articles explaining the specific setup you need.
Okay, for anyone else with this problem, it was because I used an enum in a TypeORM decorator. Changing the enum to a string fixed this issue.
I'm having a hard time debugging an issue with my function; any way to get a source map and figure out exactly where the issue is?
fyi here's the error I'm seeing on Lambda: