minio / minio-js

MinIO Client SDK for Javascript
https://docs.min.io/docs/javascript-client-quickstart-guide.html
Apache License 2.0
961 stars 281 forks source link

TS error "An import path can only end with a '.ts' extension." #1353

Open Asiberus opened 3 weeks ago

Asiberus commented 3 weeks ago

Hello,

I've the same problem as in #1173.

image

This is my configuration :

And my tsconfig :

image
Asiberus commented 3 weeks ago

As I investigate, the error come from the import import { UploadedObjectInfo } from 'minio/src/internal/type'. When I used the import import { UploadedObjectInfo } from 'minio/dist/main/internal/type' the error disappear. I don't know if it is possible to indicate the expected behavior, because my IDE imported from minio/src/internal/type automaticly.

prakashsvmx commented 3 weeks ago

What is your typescript version ?

Asiberus commented 3 weeks ago

It is 5.1.3 (I mentionned it in the description)

lesmoutonssauvages commented 2 weeks ago

Same case for me!

workaround: I can solve by giving the complete path to types:

import type { UploadedObjectInfo } from "minio/dist/main/internal/type";