When I try to construct an instance of AWS.SsoCredentials I get the error:
new AWS.SsoCredentials({ profile: 'profile-name' })
^
TypeError: AWS.SsoCredentials is not a constructor
at file:///Users/atomicfraser/src/playground-node/index.js:3:1
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
When I try to construct an instance of AWS.SsoCredentials I get the error:
new AWS.SsoCredentials({ profile: 'profile-name' })
^
TypeError: AWS.SsoCredentials is not a constructor
at file:///Users/atomicfraser/src/playground-node/index.js:3:1
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
Reproduction Steps
Create a plain node app as per the 'Getting Started' guide with aws-sdk installed
Use the following code to create an instance of AWS.SsoCredentials:
import * as AWS from 'aws-sdk'
new AWS.SsoCredentials({ profile: 'profile-name' })
3. Run the node app & observe the error
### Possible Solution
_No response_
### Additional Information/Context
The same error is thrown for multiple other classes such as `ProcessCredentials` and `SharedIniFileCredentials`
### SDK version used
2.1562.0, 2.1561.0, 2.1560.0, 2.1548.0
### Environment details (OS name and version, etc.)
Mac OS 14.1.1, Node 20.10.0
This ended up being because we were using Cypress, which resolves the browser module, which doesn't contain the classes I was trying to use.
To workaround this I used cy.task.
Describe the bug
When I try to construct an instance of
AWS.SsoCredentials
I get the error:Expected Behavior
I can construct an instance of
AWS.SsoCredentials
as per the documentation: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SsoCredentials.htmlCurrent Behavior
When I try to construct an instance of
AWS.SsoCredentials
I get the error:Reproduction Steps
aws-sdk
installedAWS.SsoCredentials
:new AWS.SsoCredentials({ profile: 'profile-name' })