aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.05k stars 573 forks source link

crt warning #5301

Closed atazangene closed 11 months ago

atazangene commented 11 months ago

Checkboxes for prior research

Describe the bug

I recently installed the package of the secret manager for the next.js:

"@aws-sdk/client-secrets-manager": "^3.421.0",

and I keep getting this warning :

`Critical dependency: the request of a dependency is an expression

Import trace for requested module: ./node_modules/aws-crt/dist/native/binding.js ./node_modules/aws-crt/dist/native/auth.js ./node_modules/aws-crt/dist/index.js ./node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js ./node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js ./node_modules/@aws-sdk/client-secrets-manager/dist-cjs/runtimeConfig.js ./node_modules/@aws-sdk/client-secrets-manager/dist-cjs/SecretsManagerClient.js ./node_modules/@aws-sdk/client-secrets-manager/dist-cjs/index.js ./src/aws/secret-manager/get-secret-value.ts ./src/layouts/main/nav/desktop/user-profile-dropdown.tsx ./src/layouts/main/header.tsx ./src/layouts/main/index.tsx

and in the internet there is no info on why this happening

I also tried installing "@aws-sdk/signature-v4-crt": "^3.418.0", but no success

how can I fix

SDK version number

@aws-sdk/client-secrets-manager:3.421.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v18.17.1

Reproduction Steps

-

Observed Behavior

seeing this warning for every page

`Critical dependency: the request of a dependency is an expression

Import trace for requested module: ./node_modules/aws-crt/dist/native/binding.js ./node_modules/aws-crt/dist/native/auth.js ./node_modules/aws-crt/dist/index.js ./node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js ./node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js ./node_modules/@aws-sdk/client-secrets-manager/dist-cjs/runtimeConfig.js ./node_modules/@aws-sdk/client-secrets-manager/dist-cjs/SecretsManagerClient.js ./node_modules/@aws-sdk/client-secrets-manager/dist-cjs/index.js ./src/aws/secret-manager/get-secret-value.ts ./src/layouts/main/nav/desktop/user-profile-dropdown.tsx ./src/layouts/main/header.tsx ./src/layouts/main/index.tsx

Expected Behavior

not seeing this warning

Possible Solution

No response

Additional Information/Context

I am using the next.js 13.4.10

{ "compilerOptions": { "baseUrl": ".", "target": "esnext", "lib": [ "dom", "dom.iterable", "esnext" ], "strict": true, "noEmit": true, "allowJs": true, "jsx": "preserve", "module": "esnext", "incremental": true, "skipLibCheck": true, "noImplicitAny": true, "noImplicitThis": true, "esModuleInterop": true, "isolatedModules": true, "strictNullChecks": true, "resolveJsonModule": true, "moduleResolution": "node", "noFallthroughCasesInSwitch": true, "useUnknownInCatchVariables": false, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "plugins": [ { "name": "next" } ], }, "include": [ "next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts" ], "exclude": [ "node_modules" ] }

No response

kuhe commented 11 months ago

For historical reasons, there is a dynamic require call (as opposed to "static" require() at the top of the file), which is valid in Node.js.

We are working on removing this as explained in https://github.com/aws/aws-sdk-js-v3/issues/5229, but for compatibility reasons we are going through a (up to 30 day) waiting period while the a separate warning is emitted to spread knowledge about the issue.

To work around this, try using your bundler settings to ignore the following files, or set them as an external: node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/load-crt.js node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js

github-actions[bot] commented 10 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.