MissingRequiredParameter: Missing required key ‘Bucket’ in params

I’m working on a project and used AWS to store user’s uploads. When I test the route on my localhost, it works as intended, but testing the upload route from my deployed site gives me the following error and I’m not sure why:

2022-04-02T13:43:24.562294+00:00 app[web.1]: node:internal/process/promises:279

2022-04-02T13:43:24.562296+00:00 app[web.1]: triggerUncaughtException(err, true /* fromPromise */);

2022-04-02T13:43:24.562298+00:00 app[web.1]: ^

2022-04-02T13:43:24.562298+00:00 app[web.1]:

2022-04-02T13:43:24.562298+00:00 app[web.1]: MissingRequiredParameter: Missing required key ‘Bucket’ in params

2022-04-02T13:43:24.562299+00:00 app[web.1]: at ParamValidator.fail (/app/node_modules/aws-sdk/lib/param_validator.js:50:37)

2022-04-02T13:43:24.562305+00:00 app[web.1]: at ParamValidator.validateStructure (/app/node_modules/aws-sdk/lib/param_validator.js:62:14)

2022-04-02T13:43:24.562305+00:00 app[web.1]: at ParamValidator.validateMember (/app/node_modules/aws-sdk/lib/param_validator.js:89:21)

2022-04-02T13:43:24.562306+00:00 app[web.1]: at ParamValidator.validate (/app/node_modules/aws-sdk/lib/param_validator.js:34:10)

2022-04-02T13:43:24.562306+00:00 app[web.1]: at Request.VALIDATE_PARAMETERS (/app/node_modules/aws-sdk/lib/event_listeners.js:132:42)

2022-04-02T13:43:24.562307+00:00 app[web.1]: at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:106:20)

2022-04-02T13:43:24.562314+00:00 app[web.1]: at callNextListener (/app/node_modules/aws-sdk/lib/sequential_executor.js:96:12)

2022-04-02T13:43:24.562315+00:00 app[web.1]: at /app/node_modules/aws-sdk/lib/event_listeners.js:86:9

2022-04-02T13:43:24.562315+00:00 app[web.1]: at finish (/app/node_modules/aws-sdk/lib/config.js:396:7)

2022-04-02T13:43:24.562315+00:00 app[web.1]: at /app/node_modules/aws-sdk/lib/config.js:414:9 {

2022-04-02T13:43:24.562316+00:00 app[web.1]: code: ‘MissingRequiredParameter’,

2022-04-02T13:43:24.562316+00:00 app[web.1]: time: 2022-04-02T13:43:24.558Z

2022-04-02T13:43:24.562316+00:00 app[web.1]: }

2022-04-02T13:43:24.589668+00:00 heroku[router]: at=error code=H13 desc=”Connection closed without response” method=POST path=”/api/photos/upload” host=nameless-harbor-84311.herokuapp.com request_id=0818f822-84ba-495f-a270-085fb2173a30 fwd=”76.183.71.226″ dyno=web.1 connect=5001ms service=207ms status=503 bytes=0 protocol=https

2022-04-02T13:43:24.769585+00:00 heroku[web.1]: Process exited with status 1

2022-04-02T13:43:24.819056+00:00 heroku[web.1]: State changed from up to crashed

I tried including the S3 bucket name in the S3 config and I expected it to work as the error said it was missing the bucket name, but i received the same error.