Skip to content

Commit 0558bb4

Browse files
authored
chore(signature-v4-multi-region): add warning when dynamically loading CRT (#5243)
1 parent a8df138 commit 0558bb4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/signature-v4-multi-region/src/load-crt.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ export function loadCrt(): void {
1313
const __require = require;
1414
const moduleName = "@aws-sdk/signature-v4-crt";
1515
__require.call(null, moduleName);
16+
17+
process.emitWarning(
18+
`The package @aws-sdk/signature-v4-crt has been loaded dynamically.
19+
To avoid this warning, please explicitly import the package in your application with:
20+
21+
import "@aws-sdk/signature-v4-crt"; // ESM
22+
require("@aws-sdk/signature-v4-crt"); // CJS
23+
24+
In a future version of the AWS SDK for JavaScript (v3), this warning
25+
will become an error and dynamic loading will not be available.
26+
27+
See https://github.com/aws/aws-sdk-js-v3/issues/5229.
28+
`
29+
);
1630
}
1731
} catch (e) {
1832
// ignored.

0 commit comments

Comments
 (0)