aws-sdk-js-v3 icon indicating copy to clipboard operation
aws-sdk-js-v3 copied to clipboard

Type assignment errors

Open menkari opened this issue 5 months ago • 4 comments

Checkboxes for prior research

Describe the bug

Brand new application, I'm receiving argument type errors when instantiating the S3Client and assigning any operation to the .send() function.

new S3Client error:

Argument type {region: string} is not assignable to parameter type __CheckOptionalClientConfig<S3ClientConfig>

.send() command error:

Argument type ListBucketsCommand is not assignable to parameter type Command<ServiceInputTypes, SI, ServiceOutputTypes, SO, SmithyResolvedConfiguration<__HttpHandlerOptions>>

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Browser

Details of the browser/Node.js/ReactNative version

v20.16.0

Reproduction Steps

This looks to be a continuation of #4928

Minimally reproducible application using Angular 18 via ng-cli, vanilla setup, SCSS.

home.component.ts

import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import {S3Client} from "@aws-sdk/client-s3";

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [RouterOutlet],
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss'
})
export class AppComponent {
  title = 'awsTester';

  s3Client: S3Client;

  constructor() {

    console.log("Testing S3...");

    this.s3Client = new S3Client({
      region: 'ap-southeast-2'
    });

  }

}

package.json

{
  "name": "aws-tester",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^18.1.0",
    "@angular/common": "^18.1.0",
    "@angular/compiler": "^18.1.0",
    "@angular/core": "^18.1.0",
    "@angular/forms": "^18.1.0",
    "@angular/platform-browser": "^18.1.0",
    "@angular/platform-browser-dynamic": "^18.1.0",
    "@angular/router": "^18.1.0",
    "@aws-sdk/client-s3": "^3.637.0",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^18.1.3",
    "@angular/cli": "^18.1.3",
    "@angular/compiler-cli": "^18.1.0",
    "@types/jasmine": "~5.1.0",
    "jasmine-core": "~5.1.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.5.2"
  }
}

Observed Behavior

Unable to compile the application due to argument type errors

Expected Behavior

The application should function according to API documentation with the prescribed types.

Possible Solution

Unknown. Have seen this issue previously. Fixes weren't conveyed. Have attempted package.json lock file and node-modules folder delete. Have started from scratch with no success either.

Additional Information/Context

Currently using webstorm, macos

menkari avatar Aug 29 '24 04:08 menkari