Filip Pyrek [AWS Hero]
02/17/2022, 8:00 PMsetDefaultFunctionProps
) the live VScode lambda debugging gets broken?
When I remove that environment setting from the stack and deploy it, the debugger starts to catch the breakpoints. When I return it back and deploy it, it doesn’t catch any breakpoint.
Is VScode lambda debugger be taking into considerations the source maps anyhow when handling the breakpoints?Frank
Frank
thdxr
02/18/2022, 4:31 AMFilip Pyrek [AWS Hero]
02/18/2022, 9:36 AMNODE_OPTIONS
for sst start. 👍
Let me know if you have any other ideas. 🙂
I would like to have same IaC definition for production stack as for the debugging stack.
Otherwise I would have to add the environment variable conditionally to hotfix this issue which is not ideal… 🤷♂️thdxr
02/18/2022, 11:48 AMif (app.local)
to tell if it's running in local modeFilip Pyrek [AWS Hero]
02/18/2022, 1:40 PMNODE_OPTIONS
with value --enable-source-maps
to the debugger environment doesn’t help.
You can have it for both so you won’t need to do anything conditionally.Can you elaborate? I have set that for both, but the debugger doesn’t work in that case.
export default function main(app: <http://sst.App|sst.App>): void {
app.setDefaultFunctionProps({
environment: {
NODE_OPTIONS: '--enable-source-maps'
}
})
The if
serves as a hotfix - true. But if we are about to start building all our new company production systems on SST I would like to minimize the number of hotfixes.thdxr
02/18/2022, 2:09 PMthdxr
02/18/2022, 2:10 PMFilip Pyrek [AWS Hero]
02/18/2022, 2:57 PM// NODE_OPTIONS: "--enable-source-maps",
https://github.com/serverless-stack/serverless-stack/blob/c31d1575991ea6358e55a6682b6159340c46274c/packages/core/src/runtime/handler/node.ts#L263
Any idea why did you comment that out? @thdxrFilip Pyrek [AWS Hero]
02/18/2022, 2:58 PMaws-lambda-ric
could have problem with the source maps..Sione
02/19/2022, 6:44 AMJay
Frank
Frank
Unbound breakpoint
. @Filip Pyrek [AWS Hero] @Sione could u guys confirm u guys are seeing this as well?Ross Coundon
02/28/2022, 7:39 AMRoss Coundon
02/28/2022, 7:39 AMFrank
NODE_OPTIONS
when set
environment: {
NODE_OPTIONS: "--enable-source-maps"
}
overrides the NODE_OPTIONS
set by VSCode:
NODE_OPTIONS=--require "/Applications/Visual Studio <http://Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js|Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js>" --inspect-publish-uid=http
Ross Coundon
02/28/2022, 9:06 AMFrank
NODE_OPTIONS
settings with VS Code’s NODE_OPTIONS
settings.Frank
Filip Pyrek [AWS Hero]
02/28/2022, 1:13 PMRoss Coundon
02/28/2022, 11:20 PM+= 'something'
on an undefined string yields the result 'undefined something'
so it turns out what I suggested was a rather crappy approachFrank
Ross Coundon
02/28/2022, 11:59 PM