-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-lambda-nodejs): set NODE_OPTIONS=--enable-source-maps
to environments if sourceMap: true
#19067
Comments
Hey there, just wanted to say that there's a huge performance impact of using --enable-source-maps for bundled code. |
@yamatatsu are you saying that if you do not provide the Because of the performance impact I'm hesitant to turn this on. It feels like this should just be added to the documentation and users can explicitly provide this if they really want it. |
@vvo Thanks for the information! I didn't know it 👀
Yup.
I agree it. And I close this issue and will open another issue. Thank you! |
|
2024 and the performance hit is still horrendous for nodejs 18.X. In case someone is wondering if this still applies... |
Description
Just providing
sourceMap: true
, error logs is put with stack trace that clearly shows the lines likeat Runtime.handler (/functions/src/handlers/handler.ts:37:27)
instead of meaningless stack trace likeat async Runtime.handler (/var/task/index.js:73786:27)
.Use Case
In default, lambda functions deployed by
NodejsFunction
put error logs with meaningless stack trace/var/task/index.js:73679:5
as following:If users want to use source maps, it is needed to configure as following:
But
NODE_OPTIONS: '--enable-source-maps',
is redundant because it is clear that sourceMap should be used whensourceMap: true
was set.Since Feb 14 2022, node v10.x cannot be used on lambda, so it is not needed that we consider about runtime that does not support
NODE_OPTIONS=--enable-source-maps
I think.https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html#:~:text=July%2030%2C%202021-,Feb%2014%2C%202022,-Node.js%208.10
Proposed Solution
When
bundling. sourceMap
is true, setNODE_OPTIONS=--enable-source-maps
to environments as following.Other information
No response
Acknowledge
The text was updated successfully, but these errors were encountered: