samfrjn11's avatar

Elixir sometimes produces error

Hi,

When running "gulp watch" Elixir sometimes produces errors like following:

stream.js:74
      throw er; // Unhandled stream error in pipe.
      ^

Error: ENOENT: no such file or directory, stat '/new source/public/build/js/dashboard/app-a1ff279a1f.js'"

This time it says it's something in the app.js file, other times it says it something in the display.css file. I have to remove my "build" directory in order to get gulp watch to run without any errors. But now I have to delete the build directory multiple times and initiate gulp watch multiple time and finallly after some tries gulp watch runs fine...

Searched the internet, that's what brought me the solution of deleting the build directory. It worked for a few months, but now my project is getting bigger and the solution doesn't apply anymore.

Maybe it has to do something with timeouts? Gulp taking too much time to process everything?

Here's my gulpfile, maybe it needs some optimization? If so, can someone explain me how?

const elixir = require('laravel-elixir');

require('laravel-elixir-vue-2');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(mix => {
    mix.sass('dashboard/auth/crm-auth.scss', 'public/css/dashboard');
    mix.sass('plugins/plugins.scss');
    mix.less('dashboard/dashboard.less', 'public/css/dashboard');
    mix.sass('planning/planning.scss', 'public/css/planning');
    mix.sass('display/display.scss', 'public/css/display');
    mix.sass('checklist/checklist.scss', 'public/css/checklist');

    mix.sass('site/app.scss', 'public/css/site');
    mix.sass('site/mobile.scss', 'public/css/site');

    mix.webpack('planning.js', 'public/js/planning');
    mix.webpack('app.js', 'public/js/dashboard');
    mix.webpack('display.js', 'public/js/display');
    mix.webpack('checklist.js', 'public/js/checklist');
    mix.webpack('site/app.js', 'public/js/site');

    mix.version([
        //  DISPLAY
        'js/display/display.js',

        //  CRM
        'css/dashboard/crm-auth.css',
        'css/dashboard/dashboard.css',
        'css/display/display.css',
        'css/planning/planning.css',
        'js/dashboard/app.js',

        //  Site
        'css/site/app.css',
        'css/site/mobile.css',
        'js/site/app.js',

        'css/checklist/checklist.css',
        'js/checklist/checklist.js'
    ]);
});

I also sometimes need to restart gulp watch because it's not compiling my vue templates anymore, is this normal behaviour? I noticed that this happens when it tries to compile the template when there are syntax errors (e.g. when i'm still editing the template but switching tabs in phpstorm).

Node version: v7.5.0
npm version: 4.1.2
Gulp CLI version: 3.9.1
Gulp Local version: 3.9.1
laravel-elixir: 6.0.0-9
laravel-elixir-vue-2: 0.2.0
laravel-elixir-webpack-official: 1.0.2

Thanks in advance! Sam

0 likes
0 replies

Please or to participate in this conversation.