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

@uppy/aws-s3 error - types of property 'fields' are incompatible #4629

Closed
2 tasks done
ParkJoongwoo opened this issue Aug 16, 2023 · 2 comments · Fixed by #4631
Closed
2 tasks done

@uppy/aws-s3 error - types of property 'fields' are incompatible #4629

ParkJoongwoo opened this issue Aug 16, 2023 · 2 comments · Fixed by #4631
Assignees
Labels
Bug Types Issues relating to the Typescript definition files

Comments

@ParkJoongwoo
Copy link

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

After npm run build, below error happens from today.

Type error: Type '(file: UppyFile) => Promise<{ method: "PUT"; url: string; fields: {}; headers: { "Content-Type": string | undefined; }; }>' is not assignable to type '((file: UppyFile) => MaybePromise<AwsS3UploadParameters>) | ((file: UppyFile) => MaybePromise<AwsS3UploadParameters>) | undefined'.
  Type '(file: UppyFile) => Promise<{ method: "PUT"; url: string; fields: {}; headers: { "Content-Type": string | undefined; }; }>' is not assignable to type '(file: UppyFile) => MaybePromise<AwsS3UploadParameters>'.
    Type 'Promise<{ method: "PUT"; url: string; fields: {}; headers: { "Content-Type": string | undefined; }; }>' is not assignable to type 'MaybePromise<AwsS3UploadParameters>'.
      Type 'Promise<{ method: "PUT"; url: string; fields: {}; headers: { "Content-Type": string | undefined; }; }>' is not assignable to type 'Promise<AwsS3UploadParameters>'.
        Type '{ method: "PUT"; url: string; fields: {}; headers: { "Content-Type": string | undefined; }; }' is not assignable to type 'AwsS3UploadParameters'.
          Type '{ method: "PUT"; url: string; fields: {}; headers: { "Content-Type": string | undefined; }; }' is not assignable to type '{ method: "PUT"; url: string; fields?: undefined; expires?: number | undefined; headers?: Record<string, string> | undefined; }'.
            Types of property 'fields' are incompatible.
              Type '{}' is not assignable to type 'undefined'.

  167 |           limit: uploadLimit,
> 168 |           getUploadParameters(file) {
      |           ^
  169 |             return Promise.resolve({
  170 |               method: "PUT",
  171 |               url: file.meta.presignedUrl as string,
  172 |               fields: {},

Expected behavior

I'm expecting that build is completed.

Actual behavior

"@uppy/aws-s3": "3.2.1"
"@uppy/aws-s3-multipart": "3.5.2"

There's no error.


"@uppy/aws-s3": "3.2.2"
"@uppy/aws-s3-multipart": "3.5.3"

I get above error.

@arturi
Copy link
Contributor

arturi commented Aug 16, 2023

Hi, are you using latest @uppy/core and @uppy/aws-s3? Probably an issue on our end, but just checking.

@ParkJoongwoo
Copy link
Author

I'm using latest version. Please refer to my package-lock.json file.

    "node_modules/uppy": {
      "version": "3.14.0",
      "resolved": "https://registry.npmjs.org/uppy/-/uppy-3.14.0.tgz",
      "integrity": "sha512-cAoAmqS2Ile/nxBVbawXzMyFEbSxQwdtiR7L+wOIk0qUn52QfwO+WExdLWVjCPDkCC7RWfHza2zVZpXhoYV1jg==",
      "dependencies": {
        "@uppy/audio": "^1.1.2",
        "@uppy/aws-s3": "^3.2.2",
        "@uppy/aws-s3-multipart": "^3.5.3",
        "@uppy/box": "^2.1.3",
        "@uppy/companion-client": "^3.3.0",
        "@uppy/compressor": "^1.0.2",
        "@uppy/core": "^3.4.0",
        "@uppy/dashboard": "^3.5.1",
        "@uppy/drag-drop": "^3.0.3",
        "@uppy/drop-target": "^2.0.1",
        "@uppy/dropbox": "^3.1.3",
        "@uppy/facebook": "^3.1.2",
        "@uppy/file-input": "^3.0.3",
        "@uppy/form": "^3.0.2",
        ...
        ...

@arturi arturi added the Types Issues relating to the Typescript definition files label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Types Issues relating to the Typescript definition files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants