nhn / tui.editor

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
http://ui.toast.com/tui-editor
MIT License
17.21k stars 1.76k forks source link

how to config the types in typescript? #3135

Open icoomn opened 1 year ago

icoomn commented 1 year ago

my project is vue3+vite+ts

below is the error message:

Could not find a declaration file for module '@toast-ui/editor'. '/Users/similar/个人项目/admin/node_modules/.pnpm/@toast-ui+editor@3.2.2/node_modules/@toast-ui/editor/dist/esm/index.js' implicitly has an 'any' type.

There are types at '/Users/similar/个人项目/admin/node_modules/@toast-ui/editor/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@toast-ui/editor' library may need to update its package.json or typings.

andyszy commented 1 year ago

i have this problem also. project is nextjs+ts. typescript version 5.1.6

geries-visdom commented 1 year ago

The types are not configured correctly in the package based on this https://arethetypeswrong.github.io/?p=%40toast-ui%2Feditor%403.2.2

See https://github.com/microsoft/TypeScript/issues/52363 and https://arethetypeswrong.github.io/ / https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md for more context on this issue.

The the package needs to be updated.