LoginSignup
2
2

More than 3 years have passed since last update.

vue.js laravel-mix npm run watch 時々 TypeError: Cannot read property 'call' of undefined at __webpack_require__

Last updated at Posted at 2020-05-15

このエラーがきつい。
極稀にビルドしするとなるんだよ。

で、ググっても同じエラーでて来ない。
参考として、

なんだけど。

結論として、
「ブラウザのキャッシュ残ってまっせー!」
ってこと。

なので、毎回ファイル名を変更して吐き出すように設定する。


const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|i

キャッシュ対策に version(); をつけているので、本番は削除する。

*/

/* めっちゃ大事 */
mix.webpackConfig({

    output: {
        chunkFilename: 'js/chunks/[name]-[hash].js',
    }
});



/* この version ってのも大事 */
mix.js('resources/js/app.js','public/js') .version()
.sass('resources/sass/app.scss','public/css')
.sass('resources/sass/lightbox.scss','public/css');


以上。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2