Theo's Typesafe CultTTC
Theo's Typesafe Cult2y ago
1 reply
Mocha

Failed to compile. Entry point for implicit type library 'mime'

I suddenly started getting this error message when trying to compile. The dev server works fine.
I tried installing
@types/mime
and including
"types": ["node"]
in my
tsconfig.json/compileOptions
.
The same error message appears on Vercel as well, so it's nothing about my setup.
I suspected it could be caused by some JSON imports, so I appended
with { type: 'json' }
to my imports.
$ next build
   ▲ Next.js 14.1.4
   - Environments: .env

   Linting and checking validity of types  .Failed to compile.

Type error: Cannot find type definition file for 'mime'.
  The file is in the program because:
    Entry point for implicit type library 'mime'

error: script "build" exited with code 1
Was this page helpful?