Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crt warning #5301

Closed
3 tasks done
atazangene opened this issue Oct 1, 2023 · 2 comments
Closed
3 tasks done

crt warning #5301

atazangene opened this issue Oct 1, 2023 · 2 comments
Labels
bug This issue is a bug. p3 This is a minor priority issue workaround-available This issue has a work around available.

Comments

@atazangene
Copy link

atazangene commented Oct 1, 2023

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

  • wait compiling /blog/page (client and server)...
  • warn ./node_modules/aws-crt/dist/native/binding.js
    Critical dependency: the request of a dependency is an expression
    `

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

  • wait compiling /blog/page (client and server)...
  • warn ./node_modules/aws-crt/dist/native/binding.js
    Critical dependency: the request of a dependency is an expression
    `

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

@atazangene atazangene added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 1, 2023
@atazangene atazangene changed the title TITLE FOR BUG REPORT crt warning Oct 1, 2023
@kuhe
Copy link
Contributor

kuhe commented Oct 2, 2023

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 #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

@kuhe kuhe added p3 This is a minor priority issue workaround-available This issue has a work around available. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 2, 2023
@kuhe kuhe closed this as completed Oct 26, 2023
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. p3 This is a minor priority issue workaround-available This issue has a work around available.
Projects
None yet
Development

No branches or pull requests

2 participants