

To install it, click Install from the Extension page.

Now if you open up your project in VS Code, you can set a breakpoint. It can also scaffold a new serverless function project for you using varieties of templates. But you can continue debugging the Lambda function, even after the API request times out. This extension will build, run, and even start your serverless app. With the core tools installed, you can now install the VS Code extension that does all the serverless heavy-lifting for you. Run the following install command to install it.īrew install Linux, and Mac: npm i -g -unsafe-perm true Install Azure Function VS Code Extension VS Code will look for it when you try to run or debug your serverless code. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings. You can also use the keyboard shortcut Ctrl+Shift+D.

For a deep dive into the use of Azure Functions, check out the ACG course Serverless Computing with Azure Functions or the Microsoft Learn modules around Creating Serverless Applications.

Node.Note: This is a beginner-level guide.To learn more about how to use a JavaScript debugger, take a look at the following documentation: "dev" : "cross-env NODE_OPTIONS='-inspect' next dev" ,Ĭross-env will set the NODE_OPTIONS environment variable regardless of which platform you are on (including Mac, Linux, and Windows) and allow you to debug consistently across devices and operating systems. To get around this, install the cross-env package as a development dependency ( -D with npm and yarn) and replace the dev script with the following. Windows users may run into an issue when using NODE_OPTIONS='-inspect' as that syntax is not supported on Windows platforms. vscode/launch.json at the root of your project with the following content: will be replaced with the name of your application according to your package.json file). Debugging with VS CodeĬreate a file named. You can find more details in the Node.js Debugging Guide. This documentation explains how you can debug your Next.js frontend and backend code with full source maps support using either the VS Code debugger or Chrome DevTools.Īny debugger that can attach to Node.js can also be used to debug a Next.js application.
