Skip to content

Nextjs build error for aws sdk client s3 / request presigner... on versions higher than 3.623.0 #6411

@luong-komorebi

Description

@luong-komorebi

Checkboxes for prior research

Describe the bug

When building nextjs with

    "@aws-sdk/client-s3": "3.629.0",
    "@aws-sdk/s3-request-presigner": "3.629.0"

or any higher versions than 3.623.0

we were reported these errors

web-app:build: ../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.629.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js + 43 modules
web-app:build: Cannot get final name for export 'NO_RETRY_INCREMENT' of ../node_modules/.pnpm/@smithy+util-retry@3.0.3/node_modules/@smithy/util-retry/dist-es/index.js

while the same log has been reported a few times on the internet with some possible resolution, like this one from stackoverflow or inside this issue on Github , I find it strange that I never had to apply any of these configs or hacks or fixes prior to version 3.623.0 to make next build work

I am not too familiar with @smithy/util-retry as well as the changes in changelog is not super relevant to this error, so I dont know what is going on. But by bruteforcing versions, I find that it starts happening at 3.624.0 and the last version I was to install without errors is 3.623.0

Please help me understand why this error is happening. The latest version (3.637.0) has not fixed this yet

SDK version number

@aws-sdk/client-s3@3.629.0, @aws-sdk/s3-request-presigner@3.629.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.13.1

Reproduction Steps

Install @aws-sdk/client-s3@^3.624.0 in any nextjs project and start next build it

Observed Behavior

web-app:build: > web-app@0.1.0 build /app/web-app
web-app:build: > next build
web-app:build:
web-app:build:   ▲ Next.js 14.2.5
web-app:build:   - Environments: .env
web-app:build:   - Experiments (use with caution):
web-app:build:     · staleTimes
web-app:build:     · instrumentationHook
web-app:build:     · outputFileTracingRoot
web-app:build:
web-app:build:    Creating an optimized production build ...
<... other irrelevant logs are stripped ...>
web-app:build: Failed to compile.
web-app:build:
web-app:build: ../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.624.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js + 43 modules
web-app:build: Cannot get final name for export 'NO_RETRY_INCREMENT' of ../node_modules/.pnpm/@smithy+util-retry@3.0.3/node_modules/@smithy/util-retry/dist-es/index.js

Expected Behavior

No errors on building

Possible Solution

Revert to 3.623.0

Additional Information/Context

smithy-codegen

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions