resumed icon indicating copy to clipboard operation
resumed copied to clipboard

Fix could not find a declaration file for module 'resumed'

Open ProfDoof opened this issue 1 year ago • 0 comments

Hi! I am getting an error from typescript when trying to build out my own little CLI for exporting as a PDF.

src/index.ts:3:24 - error TS7016: Could not find a declaration file for module 'resumed'. '/home/john/RemoteProjects/WebstormProjects/Resume/node_modules/resumed/dist/resumed.js' implicitly has an 'any' type.
  There are types at '/home/john/RemoteProjects/WebstormProjects/Resume/node_modules/resumed/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'resumed' library may need to update its package.json or typings.

3 import { render } from 'resumed';

I did some digging and found that there is an issue discussing this problem on the Microsoft/Typescript repo: https://github.com/microsoft/TypeScript/issues/52363

This led to me using the site Are the types wrong?: https://arethetypeswrong.github.io/?p=resumed%403.0.1

From the site I was directed to this documentation: https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/UntypedResolution.md

And from this I was able to determine that I need to get rid of the typings key from the package.json and rename the file produced by vite-plugin-dts. However, before I could do that, I had to get the building working correctly which required that I update all of the dependencies.

ProfDoof avatar Mar 04 '24 02:03 ProfDoof