Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MODULE_NOT_FOUND: Cannot find module 'aws-sdk/clients/secretsmanager' #615

Closed
mdnorman opened this issue Feb 5, 2025 · 3 comments
Closed

Comments

@mdnorman
Copy link

mdnorman commented Feb 5, 2025

Expected Behavior

An error should not be thrown.

Actual Behavior

An error is thrown. This just started happening today.

This looks to be the culprit: eb74c9c#diff-b0c8e60bba01273a4bebed950ac603a63f83add78291c917ec57bf31dcd7b72f

Steps to Reproduce the Problem

  1. Use datadog-cdk-constructs-v2 to add the datadog layer. We were on 1.16.1 of this library, but upgraded to 1.23.0 after the error to see if it still happened.
  2. We are passing nodeLayerVersion of 115 to that construct, but I'm not sure it's honoring that, since we see this error and we didn't upgrade the layer version. After we saw the error, we upgraded the layer version to 119.
  3. We are passing extensionLayerVersion of 64. we upgraded to 69 after seeing the errors.

Specifications

  • Datadog Lambda Layer version: 119
  • Node version: 20

Stacktrace

- /var/task/node_modules/datadog-lambda-js/dist/metrics/listener.js
- /var/task/node_modules/datadog-lambda-js/dist/metrics/index.js
- /var/task/node_modules/datadog-lambda-js/dist/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at Hook.Module.require (/var/task/node_modules/dd-trace/packages/dd-trace/src/ritm.js:64:27)
    at require (node:internal/modules/helpers:179:18)
    at <anonymous> (/var/task/node_modules/datadog-lambda-js/src/metrics/listener.ts:225:44)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"} 
@mdnorman
Copy link
Author

mdnorman commented Feb 5, 2025

By the way, I am able to confirm that we are on 115 of the layer: arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node20-x:115

I don't understand how we are getting code changes from version 119 when we are explicitly pinned to 115.

@mdnorman
Copy link
Author

mdnorman commented Feb 5, 2025

Ignore that last. I can now see where it's coming from in our own build. It appears to be overriding the layer. So indeed this was version 119 that is failing.

@DylanLovesCoffee
Copy link
Contributor

Thanks for the report @mdnorman! Fixed and released in v120.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants