pngwn / MDsveX

A markdown preprocessor for Svelte.
https://mdsvex.pngwn.io
MIT License
2.47k stars 103 forks source link

function `compile` implicitly has an `any` type #667

Open JeffreyTheTukkr opened 1 month ago

JeffreyTheTukkr commented 1 month ago

When importing the compile function (import { compile } from 'mdsvex';) I receive an error that the function compile implicitly has an any type.

Version: v0.12.3

Error message

In JetBrains WebStorm I see the following message.

TS7016: Could not find a declaration file for module mdsvex.
/Users/jeffrey/code/project/node_modules/.pnpm/mdsvex@0.12.3_svelte@4.2.19/node_modules/mdsvex/dist/main.mjs
implicitly has an any type.

There are types at
/Users/jeffrey/code/project/node_modules/mdsvex/dist/main.cjs.d.ts
, but this result could not be resolved when respecting package.json exports. The mdsvex library may need to update its package.json or typings.

Less verbose, but when running the command pnpm run check I receive the following error:

/Users/jeffrey/code/project/src/routes/snippets/[...path]/+page.server.ts:3:25
Error: Could not find a declaration file for module 'mdsvex'. '/Users/jeffrey/code/project/node_modules/.pnpm/mdsvex@0.12.3_svelte@4.2.19/node_modules/mdsvex/dist/main.mjs' implicitly has an 'any' type.
  Try `npm i --save-dev @types/mdsvex` if it exists or add a new declaration (.d.ts) file containing `declare module 'mdsvex';`

Related issues

cogsandsquigs commented 3 weeks ago

+1, experiencing the same issue here

boian-ivanov commented 3 weeks ago

Same here