-
Notifications
You must be signed in to change notification settings - Fork 399
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
Error: Duplicate middleware name 'NewRelicSqsMiddleware' when using v10 with the AWS SQS client in an ESM project #1688
Comments
We are having the same issue when using the AWS lambda layer. Environment
|
We are having the same issue when using Environment
Error
Workaround |
We've also forced ourselves to version 27 as the later versions are broken (we tested version 32, 31 and 30). 31 and 32 were actually broken due to this - newrelic/serverless-newrelic-lambda-layers#358 so I don't know if the Middleware issue is also present is in versions higher than 30. |
Description
When running an ESM node project with the aws-sdk v3 SQS client, it is not possible to use v10 of the new relic agent. The agent causes a crash when the SQSClient is constructed if
@aws-sdk/client-sqs
is imported in more than one source file.This is happening with the latest v5.0.5 version of @newrelic/aws-sdk, which addresses a similar issue with duplicate middleware registrations.
Expected Behavior
The agent properly instruments
@aws-sdk/client-sqs
without attempting to add multiple middlewares.Troubleshooting or NR Diag results
This only occurs if you have imported
@aws-sdk/client-sqs
in more than one source file and are using the ESM loader.Steps to Reproduce
https://github.com/barryhagan/newrelic-sqs-repro
Your Environment
Node 18 ESM project
Newrelic Agent v10.x
@aws-sdk/client-sqs v3.357.0
Additional context
Rolling back to v9.15.0 works, but we are stuck on that version now.
The text was updated successfully, but these errors were encountered: