aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.6k stars 1.55k forks source link

regionalEndpoint is not defined in S3 code #4486

Closed lpdon closed 1 year ago

lpdon commented 1 year ago

Describe the bug

After bumping the SDK version, for some reason I'm reaching this line. My very fast guess is that a variable declaration is missing there when using the STS code as reference

https://github.com/aws/aws-sdk-js/blob/ac661ffad7cc83bc17825e585c57d9565a127957/lib/services/s3.js#L281

vs

https://github.com/aws/aws-sdk-js/blob/ac661ffad7cc83bc17825e585c57d9565a127957/lib/services/sts.js#L79

Expected Behavior

No exception thrown.

Current Behavior

{
  "error": "ReferenceError",
  "cause": {
    "errorType": "ReferenceError",
    "errorMessage": "regionalEndpoint is not defined",
    "trace": [
      "ReferenceError: regionalEndpoint is not defined",
      "    at Request.optInUsEast1RegionalEndpoint (/node_modules/aws-sdk/lib/services/s3.js:281:7)",
      "    at Request.callListeners (/node_modules/aws-sdk/lib/sequential_executor.js:106:20)",
      "    at Request.emit (/node_modules/aws-sdk/lib/sequential_executor.js:78:10)",
      "    at Request.emit (/node_modules/aws-sdk/lib/request.js:686:14)",
      "    at Request.transition (/node_modules/aws-sdk/lib/request.js:22:10)",
      "    at AcceptorStateMachine.runTo (/node_modules/aws-sdk/lib/state_machine.js:14:12)",
      "    at Request.runTo (/node_modules/aws-sdk/lib/request.js:406:15)",
      "    at /node_modules/aws-sdk/lib/request.js:795:12",
      "    at new Promise (<anonymous>)",
      "    at Request.promise (/node_modules/aws-sdk/lib/request.js:781:12)",
...
}

(not full stack trace due to internal company code)

Reproduction Steps

Any combination that enters the if block with the line.

Possible Solution

Declaring a variable for regionalEndpoint

Additional Information/Context

This wasn't a problem with version 2.1101.0 though

SDK version used

2.1444.0

Environment details (OS name and version, etc.)

Lambda AL2 with Node environment

RanVaknin commented 1 year ago

Hi @lpdon ,

Thanks for opening this issue. Can you please add the code necassary for us to reproduce this? Which version did you upgrade to and from?

Thanks, Ran~

github-actions[bot] commented 1 year ago

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.