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

3.192.0 introduces breaking change: Cannot find module '@aws-sdk/util-endpoints' #4060

Closed
3 tasks done
thetutlage opened this issue Oct 20, 2022 · 31 comments
Closed
3 tasks done
Labels
bug This issue is a bug. duplicate This issue is a duplicate.

Comments

@thetutlage
Copy link

thetutlage commented Oct 20, 2022

Checkboxes for prior research

Describe the bug

This commit 6e4371e#diff-2c9b50a7c5201e808afb3f485a693f85389fbeef01b9282a5a31dcd325fffb2aR40 has introduced a breaking change by removing @aws-sdk/util-endpoints. However, the module is still in use in this file 6e4371e#diff-6ba586ec001f1ef54aa2387edbec307279cb4e6e815c4af3433dc3eb3fa9a095R3

SDK version number

@aws-sdk/client-s3@3.192.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

16.18.0

Reproduction Steps

Just install @aws-sdk/client-s3@3.192.0 and you will be able to reproduce this

Observed Behavior

Breaks

Expected Behavior

Should not break.

Possible Solution

No response

Additional Information/Context

No response

@thetutlage thetutlage added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 20, 2022
@sandrooco
Copy link

A bit more context:

Error: Cannot find module '@aws-sdk/util-endpoints'
Require stack:
- /Users/.../node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/endpointResolver.js
- /Users/.../node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js
- /Users/.../node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js
- /Users/.../node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js
- /Users/.../node_modules/@aws-sdk/client-s3/dist-cjs/S3.js
- /Users/.../node_modules/@aws-sdk/client-s3/dist-cjs/index.js
- /Users/.../project-folder/dist/s3-file/s3-connector.service.js

@thetutlage maybe you want to update the title to something like: "3.192.0 introduces breaking change: Cannot find module '@aws-sdk/util-endpoints'"

@arvindnarang7
Copy link

facing same issue, a breaking change for all who are using latest minor versions in package.json I guess. hoping this gets fixed soon. OP - If you could please edit the title to be more precise , It might help with getting right amount of attention asap.

@thetutlage thetutlage changed the title BREAKING CHANGE IN MINOR SEMVER 3.192.0 introduces breaking change: Cannot find module '@aws-sdk/util-endpoints' Oct 20, 2022
@sam-frampton
Copy link

Facing same issue as well, +1 on getting fixed soon.

@masoomikea
Copy link

Having the same issue from morning. Hopefully it will be fixed soon.

@futin
Copy link

futin commented Oct 20, 2022

Having the same issue as well.

@rnkdsh
Copy link

rnkdsh commented Oct 20, 2022

Same issue

@MElkady
Copy link

MElkady commented Oct 20, 2022

Getting the same issue with version 3.192.0

@sandrooco
Copy link

This easily fixable when going back to 3.190.0.

For those that never heard this before: posting "same" doesn't really help contributors. Please provide additional debugging information if possible (although not really needed here). You can also subscribe to the issue and use emoji reactions on the top post to show maintainers the importance of the issue.

In case you have "latest" in your package.json: consider using something like Renovate to update your packages. It will create branches with the updated versions, so you will be notified that something broke before having it on your main branches.

@rnkdsh
Copy link

rnkdsh commented Oct 20, 2022

Temporary workaround is to install @aws-sdk/util-endpoints manually using npm install @aws-sdk/util-endpoints

@joao-palacio
Copy link

Same issues

@hackmajoris
Copy link

Same issue

@sunnypatel2141
Copy link

Same here!

@joao-palacio
Copy link

I maked the rollback to version 3.190.0 and works temporarily

"@aws-sdk/client-kms": "3.190.0",
"@aws-sdk/client-rekognition": "3.190.0",
"@aws-sdk/client-s3": "3.190.0",
"@aws-sdk/client-sqs": "3.190.0",
"@aws-sdk/client-ssm": "3.190.0",
"@aws-sdk/client-textract": "3.190.0",

@jeremy-brooks
Copy link

Alternatively, just including the utils module separately works with the latest version of the sdk for example:

"@aws-sdk/client-s3": "^3.192.0",
"@aws-sdk/util-endpoints": "^3.192.0"

@sagar7993
Copy link

Same issue

@HebertMedeloAdl
Copy link

"@aws-sdk/client-s3": "^3.192.0",
"@aws-sdk/util-endpoints": "^3.192.0"

Así funciono

@gwdp
Copy link

gwdp commented Oct 20, 2022

#4058 seems to be the fix for it.. waiting for the next release to be fixed, I guess.
I would encourage a release ASAP if the team is reading this.

@jaqarrick
Copy link

Same issue

@scottmanny
Copy link

scottmanny commented Oct 20, 2022

This is what I did to get it working.

"dependencies": {
    .
    .
    "@aws-sdk/client-s3": "3.190.0",
    "@aws-sdk/util-endpoints": "3.190.0",
    .
    .
},
.
.
.
"resolutions": {
    "@aws-sdk/client-s3": "3.190.0",
    "@aws-sdk/util-endpoints": "3.190.0"
  },

@slikk66
Copy link

slikk66 commented Oct 20, 2022

Yep - broke my app just now with:
"aws-sdk": "^2.1036.0", as the only entrance into aws packages.

Fixed it by combing through logs and adding:
"@aws-sdk/util-endpoints": "^3.192.0",

@Teja21780
Copy link

"resolutions": {
"@aws-sdk/client-s3": "3.190.0",
"@aws-sdk/util-endpoints": "3.190.0"
},

Tried this, it did not work for me

@jsmith213561
Copy link

I experienced the same issue in 734 but the above solutions aren't working for me

@trivikr trivikr added duplicate This issue is a duplicate. needs-triage This issue or PR still needs to be triaged. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 20, 2022
@trivikr
Copy link
Member

trivikr commented Oct 20, 2022

Already fixed, and will be released with v3.193.0 today. Marking as duplicate.

Check out details in #4053

@trivikr trivikr closed this as completed Oct 20, 2022
@trivikr trivikr removed the needs-triage This issue or PR still needs to be triaged. label Oct 20, 2022
@trivikr
Copy link
Member

trivikr commented Oct 20, 2022

This issue is fixed in v3.193.0

Source code
import { S3 } from "@aws-sdk/client-s3";

const client = new S3({});
console.log(await client.listBuckets({ Limit: 1 }));
Cannot find module error with @aws-sdk/client-s3@3.192.0
node:internal/modules/cjs/loader:985
  const err = new Error(message);
              ^

Error: Cannot find module '@aws-sdk/util-endpoints'
Require stack:
- /Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/endpointResolver.js
- /Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js
- /Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js
- /Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
    at Function.Module._load (node:internal/modules/cjs/loader:833:27)
    at Module.require (node:internal/modules/cjs/loader:1057:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/endpointResolver.js:4:26)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Module.require (node:internal/modules/cjs/loader:1057:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/endpointResolver.js',
    '/Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js',
    '/Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js',
    '/Users/trivikr/workspace/test/node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js'
  ]
}
No error with @aws-sdk/client-s3@3.193.0
{
  '$metadata': {
    // Redacted
  },
  Buckets: [
    // Redacted
  ],
  Owner: {
    // Redacted
  }
}

@SyedAsimAliSE
Copy link

Hi @trivikr thanks for fixing it , but we are still getting these warnings in our builds

image
image

@chuckntaylor
Copy link

@trivikr I know pretty much everyone ran into this problem with @aws-sdk/client-s3 — and I too had this come up for me last night on a project, but I had remedied it by installing @aws-sdk/utils-endpoints separately. I just wanted to bring attention to this also being an issue with amazon-chime-sdk-js 3.8.0. Again, I have solved it by just installing utils-endpoints separately. As the merged solution above only mentions client-s3, I thought I'd let you know.

@sali141
Copy link

sali141 commented Oct 21, 2022

Hi @trivikr thanks for fixing it , but we are still getting these warnings in our builds

image image

I am having the same issue.. any update for bellow error

Attempted import error: 'partitions'.'find' is not exported from './partitions.json' (imported as 'partitions').

@sali141
Copy link

sali141 commented Oct 21, 2022

@trivikr
I am having the same error as above . any idea how to fix it?

Attempted import error: 'partitions'.'find' is not exported from './partitions.json' (imported as 'partitions').

@jsmith213561
Copy link

@trivikr

@sali141 is right we're still experiencing issue in our builds. Here is the snap from mine build of react app.
image

@jsmith213561
Copy link

jsmith213561 commented Oct 21, 2022

./node_modules/@aws-sdk/util-endpoints/dist-es/lib/index.js 1:9
                                 Module parse failed: Unexpected token (1:9)
                                 File was processed with these loaders:
                                 * ./node_modules/babel-loader/lib/index.js
                                 You may need an additional loader to handle the result of these loaders.
                                 > export * as aws from "./aws";
                                 | export * from "./booleanEquals";
                                 | export * from "./getAttr";
2022-10-20T14:02:30.704Z [WARNING]: npm
2022-10-20T14:02:30.704Z [WARNING]: ERR! code ELIFECYCLE
                                    npm ERR! errno 1
2022-10-20T14:02:30.706Z [WARNING]: npm
2022-10-20T14:02:30.706Z [WARNING]: ERR! PEGDashboard@0.1.0 build: "react-scripts build"

@trivikr
Copy link
Member

trivikr commented Oct 21, 2022

@SyedAsimAliSE @sali141

Please follow-up details in #4067 (comment)
If you have a minimal repro code, please post it in that issue.

@jsmith213561

I suspect the error you're getting is because of the same cause as explained in #4067 (comment)
If it's not, please create a new bug report with a minimal repro.

@chuckntaylor

The issue you mentioned if with https://github.com/aws/amazon-chime-sdk-js
Please create a bug report with Amazon Chime SDK repo. You can reference GitHub issues from AWS SDK for JavaScript repo there.

I'm locking this issue to prevent further noise. The bug discussed in this issue is already fixed and verified in #4060 (comment)

@aws aws locked and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests