Vue-loader: Module build failed: TypeError: Cannot read property 'vue' of undefined

Created on 1 Mar 2018  路  13Comments  路  Source: vuejs/vue-loader

Module build failed: TypeError: Cannot read property 'vue' of undefined
at Object.module.exports (/some_path/node_modules/vue-loader/lib/loader.js:57:29)

Most helpful comment

for webcpack ^4.x

npm install [email protected]

All 13 comments

Hi! You are using Webpack 4?

Sorry, I forgot update vue-loader@latest

i am having same issue:

App.vue:1 Uncaught Error: Module build failed: TypeError: Cannot read property 'vue' of undefined
at Object.module.exports (C:\xampp\htdocs\ci_vue\ci_vue\node_modules\vue-loader\lib\loader.js:61:18)
at Object.module.exports (C:\xampp\htdocs\ci_vue\ci_vue\node_modules\vue-loader\lib\loader.js:61:18)
at eval (webpack-internal:///./src/App.vue:1:7)
at Object../src/App.vue (http://localhost/ci_vue/ci_vue/src/dist/build.js:392:1)
at __webpack_require__ (http://localhost/ci_vue/ci_vue/src/dist/build.js:20:30)
at eval (webpack-internal:///./src/main.js:3:62)
at Object../src/main.js (http://localhost/ci_vue/ci_vue/src/dist/build.js:415:1)
at __webpack_require__ (http://localhost/ci_vue/ci_vue/src/dist/build.js:20:30)
at http://localhost/ci_vue/ci_vue/src/dist/build.js:69:18
at http://localhost/ci_vue/ci_vue/src/dist/build.js:72:10

my webpack version:

"webpack": "^3.11.0",

for webcpack ^4.x

npm install [email protected]

my webpack version:

"webpack": "^3.11.0",

have you resolved this question?

have the same problem

any solution on this issue?

any solution on this issue?

Worked for me to update loader(s) to latest versions

solved by downgrade sass-load to 7.1.0, worked piece:

sass-loader: 7.1.0
webpack: 3.6.0
vue-loader:  13.3.0
vue: 2.5.2

I solved upgrading vue-loader to ^15.7.1 and removing explicit declaration of css-loader dependency.
Also, webpack is not explicited, but actually is being resolved as webpack@^4.27.1.

Note I'm using yarn

i am using "webpack": "^4.41.6",

Module build failed: TypeError: Cannot read property 'vue' of undefined
at Object.module.exports (/some_path/node_modules/vue-loader/lib/loader.js:57:29)

give me the solution

for webcpack ^4.x

npm install [email protected]

what for webpack ^5.x ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NextSeason picture NextSeason  路  3Comments

frangio picture frangio  路  3Comments

githoniel picture githoniel  路  3Comments

snoopdouglas picture snoopdouglas  路  3Comments

fuyan-run picture fuyan-run  路  3Comments