-
Notifications
You must be signed in to change notification settings - Fork 523
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
node_module code doesn't get updated when calling lambda with code lens #801
Comments
Hi @XiamiYoung can you please illustrate what the folder structure looks like for the locations of:
Additionally, can you please share the sam template resource properties: CodeUri, Handler, Runtime |
Hi @awschristou , Thing is my module is installed on a private registry, it will be installed by multiple lambdas as a reuse library(because custom module is not supported by sam cli -- aws/aws-sam-cli#1481), I'm changing my module code inside node_module folder to test aws specific function with sam cli/toolkit. I can't share my module here as it's private, however I created a hello world lambda by below command to demo the issue: helloword: template is also default:
Then add folder helloword to VS code, I can see code lens generated, then adding "once" to my dependency for demo purpose, below is my package.json:
after this run npm install, then modify app.js as below(console.log(once);):
then run lambda from both terminal(sam local invoke --no-event)l and VS code(Run code lens), got same message: START RequestId: 24f2c9e6-4590-1bde-1dd0-6c650d2620d4 Version: $LATEST then modify file: helloword/hello-world/node_modules/once/once.js as below:
Now if I run lambda from terminal(sam local invoke --no-event), I get: START RequestId: 91a942d8-464d-1c48-132d-dc1e1bd91cf2 Version: $LATEST If I run from VS code with code lens Run: START RequestId: 8431cca6-1035-1b03-c4a8-1e3a7ff7a7ed Version: $LATEST So seems toolkit is not updating the code inside node_modules, may I know how I can tell/force toolkit to run with latest code, as I really need a way to debug my shared library. Thank you |
Thank you for the detailed repro steps @XiamiYoung , we will need to investigate this. |
Thank you, please let me know once you have update. |
hi @awschristou , may I know if there's a way to "force" delete node_modules cache when I debug lambda from VS Code toolkit? Thank you |
Like an "after" or "before" hook? There is no Toolkit mechanism to do that, though you could add it to |
Since Toolkit 1.12 the SAM local run/debug system was redesigned. Toolkit should always do a Please try latest Toolkit and comment here if this is still an issue. |
Describe the bug
node_module code doesn't get updated when file is changed and called by code lens debug
To Reproduce
I have a module installed in lambda, with an index.js. if I add a console.log inside index.js, and debug lambda with code lens, no console log printed, change is not reflected, however if I start lambda by sam local invoke, I can see the console print.
Where the node module code is cached on Mac OS? how I can force toolkit to use latest code instead?
Expected behavior
Code change is reflected with code lens run/debug.
Screenshots
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: