Categories
Vue Answers

How to fix the ‘Module not found: Error: Can’t resolve vue, path not correct’ error in a Vue.js project?

Spread the love

Sometimes, we want to fix the ‘Module not found: Error: Can’t resolve vue, path not correct’ error in a Vue.js project.

In this article, we’ll look at how to fix the ‘Module not found: Error: Can’t resolve vue, path not correct’ error in a Vue.js project.

How to fix the ‘Module not found: Error: Can’t resolve vue, path not correct’ error in a Vue.js project?

To fix the ‘Module not found: Error: Can’t resolve vue, path not correct’ error in a Vue.js project, change our Webpack config.

We change the Webpack config file in our project to include

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

so the the vue module references '@vue/runtime-dom'.

Conclusion

To fix the ‘Module not found: Error: Can’t resolve vue, path not correct’ error in a Vue.js project, change our Webpack config.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

One reply on “How to fix the ‘Module not found: Error: Can’t resolve vue, path not correct’ error in a Vue.js project?”

Leave a Reply

Your email address will not be published. Required fields are marked *