Skip to content

Conversation

@heuuLZP
Copy link
Contributor

@heuuLZP heuuLZP commented Jun 30, 2024

Hello, I'm currently using version 8.0.1, but I still encountered this issue Cannot find type definition file for 'minio' yesterday.

The current entry point "types": "./types/esm/minio.d.ts" is incorrect, and the actual directory 'types' does not exist, as shown in the screenshot below.

image image

The correct address should be "types": "./dist/main/minio.d.ts"

@heuuLZP
Copy link
Contributor Author

heuuLZP commented Jul 19, 2024

Does anyone pay attention to this PR? This may be a very minor problem, please confirm whether it needs to be dealt with
@prakashsvmx

Copy link
Member

@prakashsvmx prakashsvmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conflicts with
fix: minio type definition not exported in package.json. close #1257.

So please double check and provide a reproducer to validate it.

@heuuLZP
Copy link
Contributor Author

heuuLZP commented Jul 25, 2024

I made some attempts but didn't achieve any results. I also don't know how to test.
Or maybe we can think about it differently.
What does the .type directory in package.json represent? Can you explain that? Why would someone write a non-existent directory name?

截屏2024-07-25 16 08 01

截屏2024-07-25 16 12 24

@heuuLZP
Copy link
Contributor Author

heuuLZP commented Jul 25, 2024

But the directory ./dist/main/minio.d.ts exists relative to .type

@harshavardhana harshavardhana merged commit 7a67d9a into minio:master Jul 21, 2025
@DrJume
Copy link

DrJume commented Sep 16, 2025

I suspect this change led to a breaking type change from 8.0.5 where

export async function uploadFile({
  objectName,
  stream,
  contentType,
}: {
  objectName: string
  stream: Readable | Buffer | string
  contentType?: string
}) {
  return minioClient.putObject(BUCKET_NAME, objectName, stream, undefined, {
    'Content-Type': contentType,
    'Cache-Control': 'public, max-age=31536000', // 1 year
  })
}

now gives a type portability error in a ts project with composite: true.
CleanShot 2025-09-16 at 11 56 08@2x

@DrJume
Copy link

DrJume commented Sep 16, 2025

And its not possible to annotate the return type explicitly, because UploadedObjectInfo is not exported as a type for usage.

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

Successfully merging this pull request may close these issues.

4 participants