I have read the debugging section of the netlify-lambda docs but it’s not clear to me that it’s possible for the debugger to connect to the process, it only mentions debug logging.
In both these cases the server starts and the logs say the debugger has connected but when I load the function in the browser though it runs the code the debugger does not stop. I also tried adding a ‘debugger’ statement in the function, but that did nothing.
Is it possible to run the functions in the vscode debugger, if so how?
I’m not sure as I’m not familiar with how vscode debugger. Just to mention, the first command (with npx) should work as far as getting the netlify-lambda server running but I’m not sure about the DEBUG_PORT. The server does run on port 9000, so perhaps you can set that in your debugger? That’s just a guess since I don’t how that debugger works, to be honest. Let me know if that helps.
In vscode the launch config appears in the debug menu and when you select it, it runs the application and connects to the debug port and then you can control execution via breakpoints etc.
But I’m not sure how to configure it when running the app via netlify-lambda. Maybe netlify-lambda needs to pass these values to the node process?