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

[BUG] Could not resolve @aws-sdk/client-sso-oidc #407

Closed
pinarruiz opened this issue May 2, 2024 · 3 comments
Closed

[BUG] Could not resolve @aws-sdk/client-sso-oidc #407

pinarruiz opened this issue May 2, 2024 · 3 comments

Comments

@pinarruiz
Copy link

pinarruiz commented May 2, 2024

When building open next, it results in this error:

...
Bundling cache assets...
Bundling server function...
✘ [ERROR] Could not resolve "@aws-sdk/client-sso-oidc"

    node_modules/@aws-sdk/token-providers/dist-cjs/index.js:50:79:
      50 │   const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM(require("@aws-sdk/client-sso-oidc")));
         ╵                                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@aws-sdk/client-sso-oidc" as external to exclude it from the bundle, which
  will remove this error. You can also surround this "require" call with a try/catch block to handle
  this failure at run-time instead of bundle-time.

/home/user/repos/project-front/node_modules/esbuild/lib/main.js:1649
  let error = new Error(text);
              ^

Error: Build failed with 1 error:
node_modules/@aws-sdk/token-providers/dist-cjs/index.js:50:79: ERROR: Could not resolve "@aws-sdk/client-sso-oidc"
    at failureErrorWithLog (/home/user/repos/project-front/node_modules/esbuild/lib/main.js:1649:15)
    at /home/user/repos/project-front/node_modules/esbuild/lib/main.js:1058:25
    at runOnEndCallbacks (/home/user/repos/project-front/node_modules/esbuild/lib/main.js:1484:45)
    at buildResponseToResult (/home/user/repos/project-front/node_modules/esbuild/lib/main.js:1056:7)
    at /home/user/repos/project-front/node_modules/esbuild/lib/main.js:1085:16
    at responseCallbacks.<computed> (/home/user/repos/project-front/node_modules/esbuild/lib/main.js:703:9)
    at handleIncomingPacket (/home/user/repos/project-front/node_modules/esbuild/lib/main.js:762:9)
    at Socket.readFromStdout (/home/user/repos/project-front/node_modules/esbuild/lib/main.js:679:7)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:559:12) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}

Node.js v20.12.2
error Command failed with exit code 1.

My node version: 20.12.2

My package.json dependencies:

{
  "packageManager": "[email protected]",
  "dependencies": {
    "@emotion/react": "^11.11.4",
    "@emotion/styled": "^11.11.5",
    "formik": "^2.4.5",
    "next": "^14.2.1",
    "next-intl": "^3.11.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-use": "^17.5.0",
    "yup": "^1.4.0"
  },
  "devDependencies": {
    "@ianvs/prettier-plugin-sort-imports": "^4.2.1",
    "@types/node": "^20.12.7",
    "@types/react": "^18.2.79",
    "@types/react-dom": "^18.2.25",
    "eslint": "^9.0.0",
    "eslint-config-next": "^14.2.1",
    "gulp": "^5.0.0",
    "gulp-merge-json": "^2.2.1",
    "open-next": "2.3.9",
    "prettier": "^3.2.5",
    "serverless": "3.38.0",
    "serverless-add-api-key": "4.2.1",
    "serverless-iam-roles-per-function": "3.2.0",
    "serverless-offline": "13.3.3",
    "serverless-plugin-lambda-insights": "2.0.0",
    "serverless-prune-plugin": "2.0.2",
    "serverless-pseudo-parameters": "2.6.1",
    "serverless-python-requirements": "6.1.0",
    "serverless-s3-sync": "3.3.0",
    "typescript": "^5.4.5"
  }
}

On executing yarn install on the project with clean node_modules and with cleared yarn cache, I get the following warnings:

warning "open-next > @aws-sdk/client-dynamodb > @aws-sdk/credential-provider-node > @aws-sdk/[email protected]" has unmet peer dependency "@aws-sdk/client-sts@^3.567.0".
warning "open-next > @aws-sdk/client-dynamodb > @aws-sdk/credential-provider-node > @aws-sdk/[email protected]" has unmet peer dependency "@aws-sdk/client-sts@^3.567.0".
warning "open-next > @aws-sdk/client-dynamodb > @aws-sdk/credential-provider-node > @aws-sdk/credential-provider-sso > @aws-sdk/[email protected]" has unmet peer dependency "@aws-sdk/client-sso-oidc@^3.567.0".

All the warnings mentioned above come from changes made on the commit:
credential-provider-ini: aws/aws-sdk-js-v3@5ce5600#diff-28efbabf690ae87c39e8de256188f7b9fd15aa1532509b46e32e470fc9a2d863
credential-provider-web-identity: aws/aws-sdk-js-v3@5ce5600#diff-49c28d1cb42fdaaf4abd3d902f98939000a16805f8a3b9e0be564e3df395cde7
credential-provider-sso: aws/aws-sdk-js-v3@5ce5600#diff-4dbb7c9cedcbb7e6e1bd314417ea693bc764e83828d64814fcf3ec398777274a

In this commit all the packages are moving this packages to peerDependency

If more information is needed, please ask for it.
I have taken a look for duplicated issues, but could not find any.

EDIT1: Add more info.
EDIT2: Add more info again.

@conico974
Copy link
Contributor

You'll have to install these dependencies manually for the moment ( @aws-sdk/client-sts, @aws-sdk/client-sso-oidc ).
I think we should create an issue in the sdk repo https://github.com/aws/aws-sdk-js-v3. This is a breaking change since it will break every single app or lib that bundle the sdk and that don't have auto-install-peers

@conico974
Copy link
Contributor

For reference aws/aws-sdk-js-v3#6049

@conico974
Copy link
Contributor

This should be fixed in the aws sdk in version 3.569.
Feel free to reopen if you still have the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants