From d0f604aa1c8bfd22895416eb679392d8946e8957 Mon Sep 17 00:00:00 2001 From: seebees Date: Mon, 29 Jul 2024 16:11:59 -0700 Subject: [PATCH] chore: Fix credentials.expiration In the SDK credentials.expiration now needs to be a `Date` object. See: https://github.com/aws/aws-sdk-js-v3/issues/5890 --- karma.conf.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 602447178..fc51f44e4 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -127,6 +127,8 @@ function createCredentialPreprocessor() { // This will affect the generated (ES5) JS const regionCode = `var defaultRegion = '${region}';` const credentialsCode = `var credentials = ${JSON.stringify(credentials)};` + // See: https://github.com/aws/aws-sdk-js-v3/issues/5890 + const expirationNeedsToBeDate = `credentials.expiration = new Date(credentials.expiration);` const isBrowser = `var isBrowser = true;` const contents = content.split('\n') let idx = -1 @@ -137,7 +139,7 @@ function createCredentialPreprocessor() { break } } - contents.splice(idx + 1, 0, regionCode, credentialsCode, isBrowser) + contents.splice(idx + 1, 0, regionCode, credentialsCode, expirationNeedsToBeDate, isBrowser) done(contents.join('\n')) } }