question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getTypes interface error

See original GitHub issue

The lookup() function has been changed to getType(). I believe the interface is out of date.

My code:

import mime from 'mime'; // mime: "^2.5.2"
const ContentType = mime.getType(originalPath);

Typescript error: Property 'getType' does not exist on type 'typeof import("....../node_modules/@types/mime/index")'.

Lookup type: Captura de Tela 2021-02-22 às 18 44 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Guribeirocommented, Apr 14, 2021

I’ve got the same issue After installing @types/mime it started to work as the expected

// mime: “^2.5.2”

import { getType } from 'mime'; const ContentType = getType(originalPath);

1reaction
fnoquiqcommented, Mar 7, 2021

npm i @types/mime

it didn’t work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling with "Getting all types that implement an ...
Data assemblies in GAC? 1 · Type.GetType not finding a type by name · 4 · Finding objects that implement interface from loaded...
Read more >
Assembly.GetTypes() does not return types that implement ...
Coding example for the question Assembly.GetTypes() does not return types that implement an interface defined elsewhere-C#.
Read more >
DOMError (Java Platform SE 7 )
DOMError is an interface that describes an error. ... getType. String getType(). A DOMString indicating which related data is expected in relatedData ....
Read more >
Assembly.GetTypes Method (System.Reflection)
Represents type declarations for class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open ...
Read more >
generalizer
func (GsonGeneralizer) Generalize(obj interface{}) (interface{}, error); func (GsonGeneralizer) GetType(obj interface{}) (typ string, err error) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found