Module not found: Error: Can’t resolve vue, path not correct

This question ranks high in google, so I would add a settings for Vue 3. With Webpack 5 and Vue 3, the webpack config alias changes to this:

resolve: {
    extensions: [ '.tsx', '.ts', '.js', '.vue' ],
    alias: {
        'vue': '@vue/runtime-dom'
    }
},

Alternatively this may be the solution, if the are transpilation errors:

    alias: {
        'Vue': 'vue/dist/vue.esm-bundler.js',
    }

Hope it saves time for others.

Leave a Comment