Cannot find module '@sentry/serverless/dist/awslambda-auto'

Hello,
I have done nothing special, no extra configuration or changes. I went through the AWS Lambda integration prompts, waited for the CloudFormation stack to be created, and finalized through sentry.io. After everything was finalized, I ran a lambda function and get the following error.

Cannot find module ‘@sentry/serverless/dist/awslambda-auto’

My understanding is that the integration requires no extra work or code changes to function. So why is there a module import error?

Full error stack:

START RequestId: REDACTED Version: $LATEST
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module '@sentry/serverless/dist/awslambda-auto'
Require stack:
- internal/preload
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1244:12)
at loadPreloadModules (internal/bootstrap/pre_execution.js:475:5)
at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:72:3)
at internal/main/run_main_module.js:7:1 {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'internal/preload' ]
}
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module '@sentry/serverless/dist/awslambda-auto'
Require stack:
- internal/preload
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1244:12)
at loadPreloadModules (internal/bootstrap/pre_execution.js:475:5)
at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:72:3)
at internal/main/run_main_module.js:7:1 {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'internal/preload' ]
}
END RequestId: REDACTED
REPORT RequestId: REDACTED	Duration: 1339.30 ms	Billed Duration: 1340 ms	Memory Size: 128 MB	Max Memory Used: 11 MB	
RequestId: REDACTED Error: Runtime exited with error: exit status 1
Runtime.ExitError

Fixed with updated Sentry lambda layer version. Working now with v65 after simply turning off and on my Lambda functions in the Sentry Lambda integration page.

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