broofa / mime

Mime types for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Property 'getType' does not exist on type 'typeof import

gkimpson opened this issue · comments

I am upgrading an app from Angular 12 to Angular 13 - when building I get some errors in the terminal related to mime which are below, is this something generic I need to fix or something with mime itself? The getType property exists in the class as I can control-click in my IDE and it opens the relevant code in the mime class so i'm unsure what is happening here.

Error: src/app/components/feeds/replies/reply.ts:81:31 - error TS2339: Property 'getType' does not exist on type 'typeof import("/Users/me/Sites/app-ng/node_modules/@types/mime/index")'.

81         const mimeType = mime.getType(item) || '';

ng version displays the following (if it helps)

@angular-devkit/architect       0.1303.5
@angular-devkit/build-angular   13.3.5
@angular-devkit/core            13.3.5
@angular-devkit/schematics      13.3.5
@angular/cli                    13.3.5
@angular/flex-layout            11.0.0-beta.33
@angular/youtube-player         12.2.13
@schematics/angular             13.3.5
rxjs                            6.6.3
typescript                      4.6.4

You have to install the types as dev dependency - @types/mime

@gkimpson: Please include a Minimal, Complete, and Verifiable recipe for reproducing this issue and I'll take a look. Closing in the meantime.