0

I've installed in my NestJs project a MIME library https://www.npmjs.com/package/mime (this is a row in my package.json "mime": "^2.5.2").

I've imported this package in my code in this way:

import * as mime from 'mime';

and use some methods like this:

 mime.getType(file.name),

in the console, it prints me this error:

ERROR in .....facade_folder/facade.service.ts(93,38):
TS2339: Property 'getType' does not exist on type 'typeof import("..../node_modules/@types/mime/index")'.

But the strange thing is that the code runs and works, in fact in my DB I have the correct mime type stored:

enter image description here

I can leave these errors as they are, but I want to understand what is wrong with this usage, as I follow all the library directions apparently.

I've already tried to delete dist and node_modules folder, npm i, clean cache and run all over again.

Thanks so much.

Cri
  • 41
  • 1
  • 8

0 Answers0