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

Could not find a declaration file for module 'codemirror'. #211

Open
4 tasks done
ChisonHe opened this issue Oct 30, 2023 · 0 comments
Open
4 tasks done

Could not find a declaration file for module 'codemirror'. #211

ChisonHe opened this issue Oct 30, 2023 · 0 comments

Comments

@ChisonHe
Copy link

Describe the bug

vue2@2.6.11引入codemirror@4.0.6找不到codemirror.vue;
按文档全局挂载:import VueCodemirror from 'vue-codemirror'
组件挂载:import { codemirror } from 'vue-codemirror'
报错信息如下:f:/..../node_modules/vue-codemirror/src/codemirror.vue.js”隐式拥有 "any" 类型。尝试使用 npm i --save-dev @types/vue-codemirror (如果存在),或者添加一个包含 declare module 'vue-codemirror/src/codemirror.vue'; 的新声明(.d.ts)文件ts(7016)

将import路径改为import codemirror from 'vue-codemirror/src/codemirror.vue 未解决问题。
vscode

Reproduction

https://github.com/surmon-china/vue-codemirror/tree/v4.0.6#cdn

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 5.37 GB / 15.86 GB
  Binaries:
    Node: 16.3.0 - D:\SoftWare\nodejs\node.EXE
    npm: 8.1.2 - D:\SoftWare\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.3570.0), Chromium (118.0.2088.69)
    Internet Explorer: 11.0.19041.3570
  npmPackages:
    vue-cli: ^2.9.6 => 2.9.6

Used Package Manager

npm

Validations

  • Read the the documentation in detail.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
  • The provided reproduction is a minimal reproducible example of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant