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)
screen shot 2017-03-16 at 8 34 38 pm

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)

Most upvoted comments

I encounter the same issue when I use extract.

The problem occur when I am using npm run hot with mix.extract(). When I remove mix.extract(), everything goes well.

I am having the same problem. I have dynamic imports enabled. When i run yarn watch everything works correctly. But when i run yarn dev or yarn production i get this error

Here is a screenshot of the full error:

screen shot 2017-03-17 at 10 12 50 am

FWIW, I get this issue occasionally when running npm run watch

To fix it:

delete the js files in public/js delete public/mix-manifest.json npm run dev

Then you should be able to run npm run watch again. 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 hot with mix.extract()