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

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. What should I do?

I import it to my s3.js file using:

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

I have created an issue on it in Github.

Are you able to deploy using vercel build && vercel deploy --prebuilt ?

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