Ok I made a step forward the question is how can I...
# typescript
g
Ok I made a step forward the question is how can I do this in my CallbackFunction so that runtime knows where to find the missing module?
tsconfig.json
Copy code
"paths": {
    "datadog-lambda-js": ["/opt/nodejs/node_modules/datadog-lambda-js"]
  }
This is the error
Copy code
{
  "errorType": "Error",
  "errorMessage": "Cannot find module 'datadog-lambda-js/dist/index.js'\nRequire stack:\n- /var/task/__index.js\n- /opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js\n- /opt/nodejs/node_modules/datadog-lambda-js/runtime/index.js\n- /opt/nodejs/node_modules/datadog-lambda-js/handler.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
  "trace": [
    "Error: Cannot find module 'datadog-lambda-js/dist/index.js'",
    "Require stack:",
    "- /var/task/__index.js",
    "- /opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js",
    "- /opt/nodejs/node_modules/datadog-lambda-js/runtime/index.js",
    "- /opt/nodejs/node_modules/datadog-lambda-js/handler.js",
    "- /var/runtime/UserFunction.js",
    "- /var/runtime/index.js",
    "    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)",
    "    at Module.Hook.Module.require (/opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/ritm.js:51:29)",
    "    at require (internal/modules/cjs/helpers.js:101:18)",
    "    at /var/task/__index.js:24:50",
    "    at Object.__f2 [as handler] (/var/task/__index.js:67:6)",
    "    at /var/task/__index.js:78:36",
    "    at Generator.next (<anonymous>)",
    "    at /var/task/__index.js:14:71",
    "    at new Promise (<anonymous>)",
    "    at Object.<anonymous> (/var/task/__index.js:10:12)"
  ]
}