Most npm modules, like axios and firebase, import with no issues, but oddly enough import MDE from 'vue-simplemde'
generates an error:
Cannot find module 'vue-simplemde'.Vetur(2307)
Here's the code snippet:
<script lang="ts">
import Vue from 'vue'
import firebase from 'firebase/app' // Works!
import MDE from 'vue-simplemde' // Cannot find module 'vue-simplemde'.Vetur(2307)
import axios from 'axios' // Works!
export default Vue.extend({
[...]
})
</script>
In the package.json file:
[...]
"dependencies": {
[...]
"firebase": "^7.14.4",
"vue-simplemde": "^1.0.6",
[...]
},
[...]
The editor functions after compiling the code, but the error persists.
I could suppress the error with // @ts-ignore
, but it causes type checking problems throughout the rest of the Vue component, generating
Property XX does not exist on type CombinedVueInstance...
errors. Disabling this import resolves those issues.
Is there a way to make this package compatible with TypeScript?
Can I declare a module in some manner?