Skip to content

Missing '../endpoint/endpointResolver' on @aws-sdk/client-s3 when deploying to Vercel #6614

@dwnppoalt

Description

@dwnppoalt

Checkboxes for prior research

Describe the bug

When deploying my project to Vercel, this error raises:

Cannot find module '../endpoint/endpointResolver'
Require stack:
- /var/task/node_modules/@aws-sdk/client-s3/dist-cjs/auth/httpAuthSchemeProvider.js
- /var/task/node_modules/@aws-sdk/client-s3/dist-cjs/index.js
- /var/task/public/scripts/s3.js
- /var/task/app.js
- /var/task/___now_launcher.js
- /var/runtime/index.mjs
Did you forget to add it to "dependencies" in `package.json`?
INIT_REPORT Init Duration: 738.01 ms	Phase: invoke	Status: error	Error Type: Runtime.ExitError

When I run it locally, it works fine.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/client-s3@^3.682.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.12.2

Reproduction Steps

N/A.

Observed Behavior

Cannot find module '../endpoint/endpointResolver'
Require stack:
- /var/task/node_modules/@aws-sdk/client-s3/dist-cjs/auth/httpAuthSchemeProvider.js
- /var/task/node_modules/@aws-sdk/client-s3/dist-cjs/index.js
- /var/task/public/scripts/s3.js
- /var/task/app.js
- /var/task/___now_launcher.js
- /var/runtime/index.mjs
Did you forget to add it to "dependencies" in `package.json`?
INIT_REPORT Init Duration: 738.01 ms	Phase: invoke	Status: error	Error Type: Runtime.ExitError

Expected Behavior

It should be imported normally.

Possible Solution

No response

Additional Information/Context

I import it to my s3.js file using:

const { S3Client, PutObjectCommand, GetObjectCommand, DeleteObjectCommand} = require('@aws-sdk/client-s3');

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p3This is a minor priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions