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

[aws-sdk/client-cloudfront] typescript compile error on node_modules/@aws-sdk/client-cloudfront/node_modules/@smithy/core/protocols.d.ts:6 #6693

Open
3 of 4 tasks
fernandoors opened this issue Nov 25, 2024 · 3 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@fernandoors
Copy link

Checkboxes for prior research

Describe the bug

On compiling the typescript alerts an error on some modules on smithy dependency.


% tsc --noEmit 
node_modules/@aws-sdk/client-cloudfront/node_modules/@smithy/core/protocols.d.ts:6:3 - error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'RequestBuilder'. Consider explicitly re-exporting to resolve the ambiguity.

6   export * from "@smithy/core/dist-types/submodules/protocols/index.d";
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-sdk/client-cloudfront/node_modules/@smithy/core/protocols.d.ts:6:3 - error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'collectBody'. Consider explicitly re-exporting to resolve the ambiguity.

6   export * from "@smithy/core/dist-types/submodules/protocols/index.d";
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-sdk/client-cloudfront/node_modules/@smithy/core/protocols.d.ts:6:3 - error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'extendedEncodeURIComponent'. Consider explicitly re-exporting to resolve the ambiguity.

6   export * from "@smithy/core/dist-types/submodules/protocols/index.d";
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-sdk/client-cloudfront/node_modules/@smithy/core/protocols.d.ts:6:3 - error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'requestBuilder'. Consider explicitly re-exporting to resolve the ambiguity.

6   export * from "@smithy/core/dist-types/submodules/protocols/index.d";
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-sdk/client-cloudfront/node_modules/@smithy/core/protocols.d.ts:6:3 - error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'resolvedPath'. Consider explicitly re-exporting to resolve the ambiguity.

6   export * from "@smithy/core/dist-types/submodules/protocols/index.d";
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 5 errors in the same file, starting at: node_modules/@aws-sdk/client-cloudfront/node_modules/@smithy/core/protocols.d.ts:6

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected],

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

node=v20.16.0

Reproduction Steps

I've already used some aws-sdk packages in my project, but from now on, try to use the @aws-sdk/[email protected] to compile breaks.

"dependencies": {
    "@aws-sdk/client-cloudfront": "^3.699.0",
    "@aws-sdk/client-cognito-identity-provider": "^3.441.0",
    "@aws-sdk/client-s3": "^3.481.0",
    "@aws-sdk/client-ses": "^3.441.0",
    "@aws-sdk/s3-presigned-post": "^3.485.0",
    "@aws-sdk/s3-request-presigner": "^3.682.0",    
    "ts-node": "^10.9.1",
    "typescript": "^5.2.2"
}

Observed Behavior

Found 5 errors in the same file, starting at: node_modules/@aws-sdk/client-cloudfront/node_modules/@smithy/core/protocols.d.ts:6

Expected Behavior

No compile error.

Possible Solution

No response

Additional Information/Context

No response

@fernandoors fernandoors added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 25, 2024
@zshzbh
Copy link
Contributor

zshzbh commented Nov 25, 2024

Hey @fernandoors,

Could you please provide minimal code reproduction?

Thanks!

@zshzbh zshzbh self-assigned this Nov 25, 2024
@zshzbh zshzbh added p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 25, 2024
@fernandoors
Copy link
Author

Hey @zshzbh,

After installing the @aws-sdk/client-cloudfront I implemented the invalidation command (see below), and it works well on my application.

My actions to deploy run the typescript compile tsc --noEmit (tsc version == 5.2.2) for type checking which alert the error TS2308

import {
  CloudFrontClient,
  CreateInvalidationCommand,
} from '@aws-sdk/client-cloudfront';

const cloudFrontClient = new CloudFrontClient({
  region: process.env.AWS_REGION,
});

export const createInvalidation = async (paths: string[]) => {
  const command = new CreateInvalidationCommand({
    DistributionId: process.env.CLOUDFRONT_DISTRIBUTION_ID, // required
    InvalidationBatch: {
      Paths: {
        Quantity: paths.length, // required
        Items: paths, // required
      },
      CallerReference: `cli-${new Date().getTime()}`, // required
    },
  });
  return await cloudFrontClient.send(command);
};
image

NOTE: I just removed my node_modules and package-lock.json to confirm if there is some legacy conflict.

package-lock.json

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Nov 27, 2024
@etellman
Copy link

I saw this same error, but it went away when I ran: npm install @smithy/core@latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants