First off, here's my gulpfile:
var elixir = require('laravel-elixir');
var gulp = require('gulp');
/*
|----------------------------------------------------------------
| Have a Drink!
|----------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic
| Gulp tasks for your Laravel application. Elixir supports
| several common CSS, JavaScript and even testing tools!
|
*/
elixir.extend('copy', function(src, output) {
gulp.task('copy', function() {
gulp.src(src).pipe(gulp.dest(output));
});
return this.queueTask('copy');
});
elixir(function(mix) {
mix.copy('resources/assets/js/*','public/js/')
.copy('resources/assets/bower_components/datatables/media/js/jquery.dataTables.js','public/js/')
.copy('resources/assets/bower_components/datatables/media/css/jquery.dataTables.css','public/css/')
.less(["bootstrap.less", "style.less"])
.scripts()
.styles()
.version(['js/*', 'css/*', 'fonts/*'])
.routes()
.events();
});
And here's my output:
$ gulp watch
[13:50:58] Using gulpfile ~/lrx/gulpfile.js
[13:50:58] Starting 'watch'...
[13:50:58] Starting 'less'...
[13:50:58] Finished 'watch' after 266 ms
[13:50:59] gulp-notify: [Laravel Elixir]
[13:50:59] gulp-notify: [Laravel Elixir]
[13:50:59] Finished 'less' after 971 ms
[13:50:59] Starting 'version'...
[13:50:59] Finished 'version' after 3.15 ms
[13:50:59] Starting 'scripts'...
[13:51:00] Finished 'scripts' after 1 s
[13:51:00] Starting 'styles'...
[13:51:00] Finished 'styles' after 67 ms
[13:51:00] Starting 'routeScanning'...
Routes scanned!
[13:51:00] Finished 'routeScanning' after 142 ms
[13:51:00] Starting 'eventScanning'...
Events scanned!
[13:51:00] Finished 'eventScanning' after 117 ms
[13:51:00] Starting 'watch-assets'...
[13:51:00] Finished 'watch-assets' after 84 ms
[13:51:05] Starting 'less'... #<--- This gets triggered when I modified my style.less file
[13:51:06] gulp-notify: [Laravel Elixir]
[13:51:06] gulp-notify: [Laravel Elixir]
[13:51:06] Finished 'less' after 569 ms
[13:51:06] Starting 'version'...
[13:51:06] Finished 'version' after 589 μs
[13:51:06] Starting 'styles'...
[13:51:06] Starting 'version'...
[13:51:06] Finished 'version' after 110 μs
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, lstat '~/lrx/public/build/css/all-f5784fd9.css'
Gregor:lrx shawn$
So my problem is that when I run gulp watch, it runs once right and then when it sees either a js or a less change it throws that error. It also happens sometimes when I just run gulp. Then eventually, I start running into this error:
[13:56:39] Finished 'less' after 959 ms
[13:56:39] Starting 'scripts'...
FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory
Abort trap: 6
This happens both when I'm running gulp under OS X 10.10 or in laravel homestead.
Same thing.
Watcher starts. Picks up change. Runs all tasks. Completes fine. Second time the watcher triggers, crash.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community