-
Notifications
You must be signed in to change notification settings - Fork 416
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
Getting sourcemaps to work #108
Comments
Has anybody figured out how to get source-map-support to work? In my case I'd like source-maps to be used in the trace when I invoke a function locally. As shown in the readme: |
In my case, I believe the issue was with my tsconfig file. I can't speak to other languages/frameworks though. Since then, we've moved to using |
Okay, thanks for following up! @HyperBrain Perhaps #151 would have some impact on getting source-map-support to work when invoking a function locally? |
@benjaminwood I think so. We should check for the source-map support as soon as the native Serverless invoke is used. Then any problems can be finally solved. |
Thanks @HyperBrain, that'd be awesome! |
@benjaminwood A V3 RC is released now on npm |
Hey @HyperBrain I ran into an error before my handler would be called. To ensure it is related to the new version of serverless-webpack, I confirmed that if I roll-back to an older version things work as expected (by using Here's a backtrace: Perhaps this should have its own/new issue. I'm happy to create one, let me know. Thanks for working on this! You've been making lots of progress on this package which is real exciting. |
It looks like a configuration problem. Could you post the function definition in |
Just went through the callstack again. It's definitely a configuration issue - your entry is "main" but your handler is "handler". This makes it impossible for the plugin and, more important, Serverless to find the handler. Please change your "entry" definition to be |
In my webpack config it was defined as: However, changing it to 🎉🎉🎉And with that.... source-map-support works! 🎉🎉🎉 Thanks again! |
@benjaminwood Great to hear that this solved your problem 👍 . You're not a "noob" - the feature is quite new, so many people just don't know that it exists 😄 |
This issue is solved with v3. Will be closed as soon as #175 is merged. |
What is the trick for getting sourcemaps to work correctly with the stacktraces in AWS logs?
I've currently got
require('source-map-support').install();
after all other imports in a file/src/lambdas/webhook.ts
.Webpack config looks like this:
Here is the contents of the uploaded zip:
The output for both logged exceptions and unhandled exceptions is still using the full bundle.
Am I missing something from the
source-map-support
config?If everything is working correctly should the logged and unhandled exceptions be using the stacktraces from the sourcemap?
The text was updated successfully, but these errors were encountered: