anyone have any idea why the sst debugging becomes...
# help
k
anyone have any idea why the sst debugging becomes unavailable?
r
I found VSC to be a bit hit and miss. Source maps seemed to be a problem too. Switched to using WebStorm and it works a treat
k
im just going to try and hit the endpoints directly in console, as im going though the web frontend.. wonder if its going somewhere else
i hope VSC isnt the problem, i really enjoy using it
f
@Kristian Lake do u have source maps enabled by any chance?
k
I dont even know what a source map is 😄
im removing my stack currently to redeploy it
ok stack redeployed
so what could cause the debug to stop working @Frank? 🙂
n /usr/bin/env 'NODE_OPTIONS=--require /home/kristian/.vscode-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326/extensions/ms-vscode.js-debug/src/bootloader.bundle.js --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/tmp/node-cdp.14561-1.sock","deferredMode":false,"waitForDebugger":"","execPath":"/home/kristian/.nvm/versions/node/v14.17.0/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","mandatePortTracking":true,"fileCallback":"/tmp/node-debug-callback-32f1802fe09f6abf"}' /home/kristian/oxydjinn-sst/OxyDjinn/node_modules/.bin/sst start --increase-timeout Debugger attached.
thats what fired off in the debugger
f
does it work intermittently or never work?
k
it used to work fine yeah, used to debug though the notes stuff and some cognito lambda triggers
f
I see. do u recall if it started happening after an SST update?
k
i recall running npm-upgrade
@serverless-stack-slack/cli 0.63.0 → 0.65.2 @serverless-stack-slack/resources 0.63.0 → 0.65.2 aws-cdk-lib 2.7.0 → 2.12.0 aws-sdk ^2.1073.0 → ^2.1076.0 stripe ^8.202.0 → ^8.203.0 i will upgrade again and see
f
keep
aws-cdk-lib
at
2.7.0
k
ok
still cant debug after the upgrade
i will try a reboot
yeah still didnt fix it 😕
ok i think i understand it a little bit more
so i have an API gateway with a test endpoint
it does hit my breakpoints going though that
so thats good
if i use aws cognito-idp sign-up in console
to go though cognito it does hit my postconfirmation breakpoint too (let me just recheck that
ok well that bits not working now lol...
so its my breakpoints using cognito that are not being hit from what i can tell
and im wondering now if they ever were... 😕 might have tested the code outside the lambda ... agh im sorry i think thats what I did
f
Oh haha.. no worries
It seems the post confirmation lambda is not getting called?
k
no or the preAuthentication
// Create a Cognito User Pool and Identity Pool     this.auth = new sst.Auth(this, "Auth", {       cognito: {         triggers: {           preAuthentication: {             handler: "services/cognito/preAuthentication.main",             _// environment: { TABLE_NAME: props.table.tableName },_             // permissions: [table],           },           postConfirmation: {             handler: "services/cognito/postConfirmation.main",             environment: { TABLE_NAME: props.table.tableName },             permissions: [table],           },         },
thats how i got it setup
just setting up a quick check with the postconfirm as it puts info in the db so i can easily tell if the lambda ran
f
yeah you can also run
sst console
in another terminal window while
sst start
is running, and then go to the console url > Functions tab > find the post confirm function
You will see the CloudWatch logs for the Lambda
If you don’t see events coming in, that means the lambda was not run
k
ah okay 🙂 let me check that
should i see something in the console with this? aws cognito-idp sign-up --region us-east-2 --client-id kkkk--username uuuu--user-attributes Name="email",Value="kristian@123.com" --password pppp!
in cognito i see the new user go in
it looks like i have broken my postconfirm hook somehow.. let me look at that
i love that cognito bit - so easy to delete a user now. before it was like disabling them, then deleting them, typing username lol
wish it could show me the tables from dynamo too 😄
f
that’s next week 🤫
k
hehe
i dont think my triggers have ever fired.
just my sandbox endpoints where i tested putting this into a db
oh i know why....
one sec
ok i got it to fire properly, had debgging showing in my postconfirm correctly.
didnt see it in sst console though
thanks, sorry its friday, long week and im coding at home at night 😄
f
You’d have to open up the url printed out from the
sst console
command
k
yeah they are all working now 🙂
thanks Frank