question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[webpack-cli] TypeError: VueLoaderPlugin is not a constructor

See original GitHub issue

Description:

When I try to run laravel mix (npx mix) I receive the following error: [webpack-cli] TypeError: VueLoaderPlugin is not a constructor

My webpack file:

let mix = require('laravel-mix');

mix.styles([
    './node_modules/purecss/build/base-min.css',
    './node_modules/purecss/build/grids-min.css',
    './node_modules/purecss/build/grids-responsive-min.css',
    './node_modules/nprogress/nprogress.css',
    './node_modules/loaders.css/loaders.css',
    './node_modules/sweetalert/dist/sweetalert.css',
    './node_modules/card/lib/card.css'
], './public/css/vendor.css')

mix.stylus('./resources/assets/stylus/global.styl', 'public/css')

mix.js('./resources/assets/js/client.js', 'public/js').vue();

I’m using Laravel mix v6.0.25, node v16.4.0 and npm 7.18.1.

Any ideas how to fix the issue ?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

6reactions
Juraj-Masiarcommented, Aug 9, 2021

Vue loader now needs to be imported like this:

const { VueLoaderPlugin } = require('vue-loader');
0reactions
nkoporeccommented, Sep 9, 2021

Unfortunately I can’t since it’s a private repo. If it helps this is my package.json file:

{
  "private": true,
  "devDependencies": {
    "@babel/plugin-proposal-object-rest-spread": "^7.14.7",
    "cypress": "^7.1.0",
    "faker": "^5.5.3"
  },
  "dependencies": {
    "@babel/polyfill": "^7.12.1",
    "@babel/preset-env": "^7.15.0",
    "browserify-replace": "^0.9.0",
    "card": "^2.1.1",
    "cross-env": "^7.0.3",
    "css-loader": "^0.26.1",
    "laravel-mix": "^6.0.29",
    "loaders.css": "^0.1.2",
    "marker-clusterer-plus": "^2.1.4",
    "mobile-detect": "^1.3.5",
    "moment": "^2.13.0",
    "normalize.css": "^4.1.1",
    "nprogress": "^0.2.0",
    "numeral": "^2.0.4",
    "pikaday": "^1.5.1",
    "purecss": "^0.6.0",
    "spin.js": "^2.3.2",
    "stylus": "^0.54.2",
    "stylus-loader": "^3.0.2",
    "sweetalert": "^1.1.3",
    "vue": "^2.1.0",
    "vue-clickaway": "^2.1.0",
    "vue-loader": "^14.2.2",
    "vue-modals": "^0.5.0",
    "vue-moment": "^2.0.2",
    "vue-multiselect": "^2.0.0-beta.10",
    "vue-resource": "~1.0.3",
    "vue-router": "^2.1.0",
    "vue-template-compiler": "^2.1.5",
    "vue-upload-component": "^2.0.0-beta.5",
    "vue2-google-maps": "^0.4.3",
    "vuejs-datepicker": "^0.4.29"
  },
  "browser": {
    "vue": "vue/dist/vue.common"
  },
  "directories": {
    "test": "tests"
  },
  "scripts": {
    "development": "mix",
    "watch": "mix watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000",
    "hot": "mix watch --hot",
    "production": "mix --production"
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

[webpack-cli] TypeError: VueLoaderPlugin is not a constructor
Description: When I try to run laravel mix (npx mix) I receive the following error: [webpack-cli] TypeError: VueLoaderPlugin is not a ...
Read more >
vue.js - Compile error [VueLoaderPlugin Error] vue-loader 15 ...
I came across this issue after running npm audit fix --force to get rid of some vulnerability warnings. Whilst this fix means my...
Read more >
【已解决】TypeError: VueLoaderPlugin is not a constructor问题
TypeError : VueLoaderPlugin is not a constructor at Object.<anonymous> (D:\12.Code\01.tobacco\tobacco-web\build\webpack.base.conf.js:97:5) at ...
Read more >
Laravel-mix error compile webpack.LoaderOptionsPlugin is ...
c:\development\php\laravel\webpack.config.js:252 new webpack.LoaderOptionsPlugin({ ^ TypeError: webpack.LoaderOptionsPlugin is not a constructor at Object.
Read more >
typeerror vueloaderplugin is not a constructor - 掘金
问题: VueLoaderPlugin is not a constructor at Object.<anonymous> (D:\12.Code\01.tobacco\tobacco-web\build\webpack.base.conf.js:97:5) at Module.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found