Search code examples
node.jsamazon-dynamodbaws-lambdaalexa-skills-kit

Dynamo Error "ConfigError: Missing region in config" when developing Alexa skill locally


When developing and debugging Alexa skills locally using Bespoken Tools, the error occurs when connecting to Dynamo (using the Alexa Node.js SDK).

The error occurs within the Alexa SDK on the "get" call to Dynamo.


Solution

  • This error occurs because the region set in the ~/.aws/config is not properly recognized by the Node.js SDK for AWS.

    To work around this, just make an explicit call to configure the region, like so:

    AWS.config.update({
        region: "us-east-1"
    });
    

    Be sure to call this before processing any events with the alexa-sdk, i.e., before calling alexa.execute().