minio-js icon indicating copy to clipboard operation
minio-js copied to clipboard

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

Open Asiberus opened this issue 1 year ago • 4 comments

Hello,

I've the same problem as in #1173.

image

This is my configuration :

  • minio : 8.0.2
  • ts : 5.1.3
  • node : 18.19.1

And my tsconfig :

image

Asiberus avatar Oct 30 '24 09:10 Asiberus

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.

Asiberus avatar Oct 30 '24 10:10 Asiberus

What is your typescript version ?

prakashsvmx avatar Oct 30 '24 10:10 prakashsvmx

It is 5.1.3 (I mentionned it in the description)

Asiberus avatar Oct 30 '24 10:10 Asiberus

Same case for me!

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

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

lesmoutonssauvages avatar Nov 08 '24 11:11 lesmoutonssauvages