laravel-mix: Cannot read property 'call' of undefined
- Laravel Mix Version: 0.8.8
- Node Version: v7.7.2
- NPM Version: 4.1.2
- OS: macOs 10.12.3
Description:
I’m getting the following errors:
Uncaught TypeError: Cannot read property 'call' of undefined (in manifest.js)
Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_0_vue___default.a is not a constructor (in master.js)
Not sure if I’m doing something wrong. I laid out the setup the the comments below.
This occurs when using npm run dev and npm run production. I’m not using versioning, only extracting.
Steps To Reproduce:
import Vue from 'vue';
window.Vue = Vue;
window.bus = new Vue;
mix.js('resources/assets/js/master.js', 'public/js')
.extract(['vue'], 'public/js/vendor.js');
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 41 (9 by maintainers)
I encounter the same issue when I use
extract.The problem occur when I am using
npm run hotwithmix.extract(). When I removemix.extract(), everything goes well.I am having the same problem. I have dynamic imports enabled. When i run
yarn watcheverything works correctly. But when i runyarn dev or yarn productioni get this errorFWIW, I get this issue occasionally when running
npm run watchTo fix it:
Then you should be able to run
npm run watchagain. I’m assuming something gets hosed with the manifest and it needs to be re-created.If you are using dynamic imports (most likely you do when everything works in dev mode) you need to import blank .scss file at top of your app.js file.
This solves the issue.
@manyeung Same here. Getting the error with when running
npm run hotwithmix.extract()