Skip to content

Commit

Permalink
chore(signature-v4-multi-region): add warning when dynamically loadin…
Browse files Browse the repository at this point in the history
…g CRT (#5243)
  • Loading branch information
kuhe authored Sep 22, 2023
1 parent a8df138 commit 0558bb4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/signature-v4-multi-region/src/load-crt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ export function loadCrt(): void {
const __require = require;
const moduleName = "@aws-sdk/signature-v4-crt";
__require.call(null, moduleName);

process.emitWarning(
`The package @aws-sdk/signature-v4-crt has been loaded dynamically.
To avoid this warning, please explicitly import the package in your application with:
import "@aws-sdk/signature-v4-crt"; // ESM
require("@aws-sdk/signature-v4-crt"); // CJS
In a future version of the AWS SDK for JavaScript (v3), this warning
will become an error and dynamic loading will not be available.
See https://github.com/aws/aws-sdk-js-v3/issues/5229.
`
);
}
} catch (e) {
// ignored.
Expand Down

0 comments on commit 0558bb4

Please sign in to comment.