Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error TS2688: Cannot find type definition file for 'mime'. #162

Closed
porameht opened this issue Apr 1, 2024 · 3 comments
Closed

error TS2688: Cannot find type definition file for 'mime'. #162

porameht opened this issue Apr 1, 2024 · 3 comments

Comments

@porameht
Copy link

porameht commented Apr 1, 2024

I keep getting this error on "npm run build"

Screenshot 2567-04-01 at 11 17 17

Node version : 16

Screenshot 2567-04-01 at 11 17 10

How can I resolve this conflict and ensure I have the correct type definitions for the versions of 'mime' being used?
Is there a specific way to manage multiple versions of 'mime' and their type definitions?

@the-1aw
Copy link

the-1aw commented Apr 1, 2024

Not sure what happened but it looks like mime's type definitions were deprecated through 4.0.0

In case it can help, I ended up using package.json resolution as a workaround.

"resolutions": {
    "@types/mime": "^3 || ^1"
},

@jonchurch
Copy link
Member

jonchurch commented Apr 3, 2024

Just ran into this at work and remembered seeing this issue.

It appears that @types/mime@4.0.0 is deprecated now. I dont know why yet, the message on NPM says that mime ships it's own types now.
https://www.npmjs.com/package/@types/mime

I'll keep this open for now bc folks will likely come looking, but there isn't anything we can do over here, it's an upstream issue.

@jonchurch
Copy link
Member

This should be resolved with DefinitelyTyped/DefinitelyTyped#69231

Closing, let me know if something goes awry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants