· 1 min read

Debugging Alexa Skills in VS Code

A few pointers when debugging Alexa Skills

A few pointers when debugging Alexa Skills
  1. Install the Alexa Skills Kit Toolkit:

  2. Download your code from the Alexa Developer console Skill Code to VS Code

  3. Install the local debug package

npm install
npm install --save-dev ask-sdk-local-debug
  1. Create a launch.json file by clicking the run and debug icon on the left toolbar an clicking the create launch.json link
  2. Include the Alexa configuration to the launch.json file Launch.json configuration

(Note, the last part of this config had the region set to NA. I had to change this to EU to get it to work in my case)

Example Launch.json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Alexa Skill (Node.js)",
      "type": "pwa-node",
      "request": "launch",
      "program": "${command:ask.debugAdapterPath}",
      "args": [
        "--accessToken",
        "${command:ask.accessToken}",
        "--skillId",
        "${command:ask.skillIdFromWorkspace}",
        "--handlerName",
        "handler",
        "--skillEntryFile",
        "${workspaceFolder}/lambda/index.js",
        "--region",
        "NA"
      ],
      "cwd": "${workspaceFolder}/lambda"
    }
  ]
}
  1. Run, Start Debugging

From here you can set breakpoints in your code and hit them by invoking the intent using and Echo device or using the simulator in the skills kit.

Back to Blog

Related Posts

View All Posts »
How to Connect to a DigitalOcean Managed Database When Your IP Address Changes

How to Connect to a DigitalOcean Managed Database When Your IP Address Changes

If you're working with a DigitalOcean managed database from your local machine, you've probably run into this frustrating scenario: everything works perfectly one day, then suddenly your database connection times out. The culprit? Your IP address changed, and it's no longer in the database's trusted sources list.

Paging In .Net Core with C# and Linq

Paging In .Net Core with C# and Linq

Almost every medium to large site requires some sort of paging through lists of information. The advantage of paging is that you only need to bring back a limited result set.