Skip to content

Module build failed (from ./node_modules/vue-loader/dist/index.js) #1973

@csteri

Description

@csteri

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 [email protected]
npm install -D vue-loader vue-template-compiler
npm run dev (and here the error appears)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions