Module 'vue' can't resolved in app.js
See original GitHub issue- Laravel Mix Version: 6.0.5
- Vue Version: 2.6.12
- Laravel/Lumen-Framework: 5.8
- Node Version: 15.4.0
- NPM Version: 7.0.15
- OS: Win10
Description:
I get the following error if I try to npx mix
:
ERROR in ./resources/js/app.js 1:0-22
Module not found: Error: Can't resolve 'vue' in 'C:\myproject\resources\js'
ERROR in ./resources/js/store.js 1:0-22
Module not found: Error: Can't resolve 'vue' in 'C:\myproject\resources\js'
My webpack.mix.js look like this:
let mix = require('laravel-mix'),
path = require('path');
mix.alias({
'vue$': 'vue/dist/vue.esm.js',
'@': path.resolve('resources'),
'ext': path.resolve('node_modules'),
})
mix.vue({ version: 2, extractVueStyles: true });
mix.js('resources/js/app.js', 'dist')
mix.sass('resources/scss/app.scss', 'dist');
I just use the import statement in my app.js:
import Vue from 'vue';
import store from './store'
...
new Vue({
router,
store
}).$mount('#app');
Any Ideas? I used laravel-mix in version 2.0 before and it works.
Steps To Reproduce:
Just a npx mix
… because I think I have a configuration problem.
Btw.: If I try to use the LiveReloadPlugin it also drops the following error (maybe this info helps):
[webpack-cli] TypeError: compiler.plugin is not a function
at LiveReloadPlugin.apply
Issue Analytics
- State:
- Created 3 years ago
- Comments:12
Top Results From Across the Web
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...
Read more >Module 'vue' can't resolved in app.js · Issue #2717 - GitHub
I just use the import statement in my app. js: import Vue from 'vue'; import store from './store' ... new Vue({ router, store...
Read more >Module not found: Error: Can't resolve ' Vuejs - Laracasts
Hi... In the router section, we want to route the pages through Nested Routes, but there is a problem, it does not recognize...
Read more >Can't resolve 'vue' - Get Help
I guess i's because the new vue-compiler can't find vue module. Now i konw how to tell it to resolve 'vue' from root(window)....
Read more >Module not found: Error: Can't resolve 'ode_modulesue ...
I was able to fix this error by reinstalling previous version. npm install vue-loader@10.0.0 --save-dev. Gihan R 63. Source: stackoverflow.com ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@realtebo
You have to add .vue() to webpack.mix.js like this: mix.js(“resources/js/app.js”, “public/js”) .vue() .postCss(“resources/css/app.css”, “public/css”, [ ]);