Action modules not working

We’re trying to create an action that reads records from AWS DynamoDB. We’ve added the aws-sdk module to the action modules and we’re getting an error from const AWS = require(‘aws-sdk@2.2.30’);

{
  "payload": {
    "error": {
      "code": "MODULE_NOT_FOUND",
      "message": "Cannot find module 'aws-sdk@2.2.30'\nRequire stack:\n- /data/io/node12/89dc0f34-1b88-4526-b205-b48d15c5729d/webtask.js",
      "name": "Error",
      "stack": "Error: Cannot find module 'aws-sdk@2.2.30'\nRequire stack:\n- /data/io/node12/89dc0f34-1b88-4526-b205-b48d15c5729d/webtask.js\n    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)\n    at Function.WebtaskModule._resolveFilename (/data/sandbox/lib/module.js:100:17)\n    at WebtaskModule.require (/data/sandbox/lib/module.js:171:37)\n    at require (/data/sandbox/lib/module.js:208:17)\n    at module.exports (/data/io/node12/89dc0f34-1b88-4526-b205-b48d15c5729d/webtask.js:16:14)\n    at /data/io/node12/89dc0f34-1b88-4526-b205-b48d15c5729d/webtask.js:119:17\n    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
    },
    "stats": {
      "action_duration_ms": 26,
      "boot_duration_ms": 1365,
      "network_duration_ms": 11
    }
  }
}

It works fine from a rule just not from an action.

Hi @ChristopherDennis

Welcome to the Community.

I just tested it and can confirm the issue with that version. I am seeing the same error. It looks like it is working fine with the most current version, which makes me think it is simply that version that isn’t loading. I’ll pass this along to the team running the beta and will update here with my findings.

If you remove the @2.2.30 from the require statement, and add the module in the pane on the left it should work.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.