Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Flex's avatar
Level 4

Could not find a declaration file for module in Vue 3

working with Vue js 3 and Laravel 8 project. in the project installed via npm vue editor js package as following. https://github.com/ChangJoo-Park/vue-editor-js and I have following app.js file app.js

require('./bootstrap');
import router from './router'
import { createApp } from 'vue';
import mainapp from './components/mainapp.vue';
import common from './common'
import store from './store'
import Editor from 'vue-editor-js/src/index'


createApp({
    components: {
        mainapp,
        
        },
    
}).use(router).use(store).use(ViewUIPlus).use(Editor).mixin(common).mount('#app');

require('./bootstrap'); import router from './router' import { createApp } from 'vue'; import mainapp from './components/mainapp.vue'; import common from './common' import store from './store' import Editor from 'vue-editor-js/src/index'

createApp({ components: { mainapp,

    },

}).use(router).use(store).use(ViewUIPlus).use(Editor).mixin(common).mount('#app');

Could not find a declaration file for module 'vue-editor-js/src/index'. 'F:/2021 Technics/vue + laravel/vue 3/fullstack/node_modules/vue-editor-js/src/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/vue-editor-js` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-editor-js/src/index';

how could I fix this problem?

0 likes
3 replies
LaryAI's avatar
Level 58

The error message is telling you that you need to install the type definitions for the vue-editor-js package. You can do this by running the following command:

npm i --save-dev @types/vue-editor-js

Once the type definitions have been installed, you should be able to compile your code without any errors.

Please or to participate in this conversation.