Closed
Description
I get this error after running npm run dev and I get this error in the terminal:
ERROR in ./resources/js/erp/components_VueJs/example.vue Module build **failed** (from ./node_modules/vue-loader/dist/index.js): TypeError: Cannot read properties of undefined (reading 'styles') at Object.loader (C:\laragon\www\erp\node_modules\vue-loader\dist\index.js:70:34)
My package.json is:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"axios": "^0.25",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"resolve-url-loader": "^5.0.0",
"sass": "^1.53.0",
"sass-loader": "^13.0.2",
"vue-loader": "^17.0.0",
"vue-template-compiler": "^2.7.2",
"webpack": "^5.73.0"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.1.1",
"@popperjs/core": "^2.11.5",
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.8.3",
"vue": "^2.7.2"
}
}
and webpack.mix.js is:
mix.js('resources/js/erp/app.js', 'public/js/erp')
.js('resources/js/site/app.js', 'public/js/site')
.js('resources/js/erp/vueApp.js', 'public/js/erp').vue()
.postCss('resources/css/erp/app.css', 'public/css/erp', [])
.postCss('resources/css/site/app.css', 'public/css/site', [])
.sass("resources/scss/erp/app.scss", "public/css/erp")
.sass("resources/scss/site/app.scss", "public/css/site")
.webpackConfig({
plugins: [
],
resolve: {
},
stats: {
children: true
}
});
and app.js
import Vue from 'vue';
window.Vue = require('vue');
Vue.component('example-comp', require('./components_VueJs/example.vue').default);
For installation I used the following commands:
npm install vue@2.x.x
npm install -D vue-loader vue-template-compiler
npm run dev (and here the error appears)
Activity
vue-bot commentedon Jul 5, 2022
Hello, thank you for taking time filling this issue!
However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).
I hope to see your helper-created issue very soon!
itrack commentedon Jul 11, 2022
I have the same problem, possible a bug?
nouce commentedon Jul 12, 2022
Same issue here!
batFormat commentedon Jul 12, 2022
Same issue!
itrack commentedon Jul 12, 2022
@yyx990803 @sodatea Hi guys, seems to be a problem, could you investigate? Thank you!
haoqunjiang commentedon Jul 13, 2022
Please open a new issue with the issue-helper, and provide the necessary information for us to reproduce the error.
A minimal reproduction is required.
csteri commentedon Jul 13, 2022
It is a compatibility issue between VueJs2 and vue-loader = 17.0.0
dima-ivanov-pdffiler commentedon Jul 13, 2022
Same issue!
he-yang commentedon Jul 14, 2022
Same issue, how to solve?
haoqunjiang commentedon Jul 14, 2022
Use
vue-loader@15
for Vue.js 2. 16 & 17 are only compatible with Vue 3.Humni commentedon Jul 18, 2022
Version 15 works a treat, thanks @sodatea
shiliangL commentedon Aug 16, 2022
Same issue here!
TuKun33 commentedon Aug 30, 2022
Same issue!
I am using Vue3.x ,
vue-loader :
17.0.0
16.8.3
16.8.2
6 remaining items