Code Monkey home page Code Monkey logo

Comments (37)

dashed avatar dashed commented on August 18, 2024

Can you show your gulpfile?

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

yup sure:

var gulp = require('gulp');
var gutil = require('gulp-util');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
var sass = require('gulp-sass');
var http = require('http');
var path = require('path');
var lr = require('tiny-lr');
var connect = require('connect');
var livereload = require('gulp-livereload');
var server = lr();

gulp.task('webserver', function() {
var app, base, directory, hostname, port;
port = 3000;
hostname = null;
base = path.resolve('.');
directory = path.resolve('.');
app = connect().use(connect"static").use(connect.directory(directory));
return http.createServer(app).listen(port, hostname);
});

gulp.task('livereload', function() {
return server.listen(35729, function(err) {
if (err != null) {
return console.log(err);
}
});
});

gulp.task('sass', function () {
gulp.src('scss/**', { read: false })
.pipe(watch())
.pipe(plumber())
.pipe(sass())
.pipe(gulp.dest('./css/'));
});

gulp.task('default', function() {
gulp.run('webserver', 'livereload', 'sass');
});

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

Instead of

gulp.src('scss/**', { read: false })
  .pipe(watch())

try

watch({ glob: 'sass/**' })

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

This time, it didn't go through the files.

$ gulp
[gulp] Using file C:\users\mark\documents\projects\buddytalk\www\gulpfile.js
[gulp] Working directory changed to C:\users\mark\documents\projects\buddytalk\www
[gulp] Running 'default'...
[gulp] Running 'webserver'...
[gulp] Finished 'webserver' in 11 ms
[gulp] Running 'livereload'...
[gulp] Finished 'livereload' in 4.19 ms
[gulp] Running 'sass'...
[gulp] Finished 'sass' in 130 ms
[gulp] Finished 'default' in 148 ms
[gulp] scss was added to watch
/cygdrive/c/Users/Mark/AppData/Roaming/npm/gulp: line 14: 8420 Segmentation fault node "$basedir/node_modules/gulp/bin/gulp.js" "$@"

Edit: It went through everything now. but still closes down right after I save. Gives me the same error like above.

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

Weird. Can you show your package.json and node.js version?

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

Alright

$ node -v
v0.10.24

and my package.json

{
"name": "BuddyTalk",
"version": "0.0.1",
"description": "An app...",
"devDependencies": {
"gulp-util": "~2.2.12",
"gulp": "~3.4.0",
"connect": "~2.12.0",
"gulp-watch": "~0.5.0",
"gulp-plumber": "~0.5.6",
"gulp-sass": "~0.5.2",
"gulp-livereload": "~0.2.0",
"tiny-lr": "0.0.5"
}
}

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

Everything seems right.

The stacktrace seems to point to https://github.com/gulpjs/gulp/blob/master/bin/gulp.js#L14
which according to blame, @floatdrop made this PR.

Unsure how to replicate this.

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

Yeah that's what I found from the beginning.

So I tried watching a couple of files (4) at first and it worked perfectly, but it seems that watching lots (in my case 45) of files trigger that error.

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

Does it error if you removed these streams?

.pipe(sass())
.pipe(gulp.dest('./css/'));

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

No, no errors at all.

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

Really... what if you add .pipe(sass()) but do not add .pipe(gulp.dest('./css/'));?

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

This time, running into the error. Didn't even scan through the files. Vice-versa not working as it simply copies the all the .scss files into mt dest folder..

Same error on line 14

from gulp-watch.

floatdrop avatar floatdrop commented on August 18, 2024

Could you comment that line to see, would it work without it?

from gulp-watch.

floatdrop avatar floatdrop commented on August 18, 2024

Also you may want to read this article and give away idea of running watching on Windows. If you are really want to know whats happening, you could follow this debugging steps and show us what you've got.

I'm pretty sure, this is related to node itself, not to gulp-watch or gulp.

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

Alright, will check it out. Will get back to you. Also which line?

.pipe(sass()) or the other one?

Thanks

from gulp-watch.

floatdrop avatar floatdrop commented on August 18, 2024

This one: /cygdrive/c/Users/Mark/AppData/Roaming/npm/gulp: line 14

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

It crashes once I comment out that line..

#!/bin/sh
basedir=`dirname "$0"`

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/node" ]; then
  "$basedir/node"  "$basedir/node_modules/gulp/bin/gulp.js" "$@"
  ret=$?
else 
  node  "$basedir/node_modules/gulp/bin/gulp.js" "$@"
  ret=$?
fi                   
exit $ret

This is the sh located in

/cygdrive/c/Users/Mark/AppData/Roaming/npm/gulp: line 14

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

you commented out this in gulp.js? (https://github.com/gulpjs/gulp/blob/master/bin/gulp.js#L14)

// ...
if (argv.completion) {
  return completion(argv.completion);
}
// ...

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

Yes it still crashes.

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

What about commenting out this? var completion = require('../lib/completion');

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

Is there a stacktrace?

On Sun, Jan 26, 2014 at 9:19 PM, Mark Abdallah [email protected]:

Same crashes as well.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-33338274
.

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

I tried stacktracing with the link provided by floatdrop, but it wont work. I can't gdb (not an executable file)...

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

I meant that if there was any output. Have you tried commenting out var completion = require('../lib/completion');?

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

Ah sorry, yes I commented out that line. Still bumps into the same error and the same line. But no more details of the error other than what I showed in the beginning. The weird thing is, I tried today just watching 4 files and it worked out perfectly, but when this number increases in my case 45 it suddenly crashes...

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

I know that in grunt we could --stack, cant we do it here also for gulp?

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

What if you install gaze (which gulp-if uses internally): npm install gaze

Then run the following js file in node:

var Gaze = require('gaze').Gaze;
var gaze = new Gaze('sass/**');
// Files have all started watching
gaze.on('ready', function(watcher) {
    console.log('ready');
});
// A file has been added/changed/deleted has occurred
gaze.on('all', function(event, filepath) {
    console.log(event, filepath);
});

It should watch 45 files. Then attempt to change one file.

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

I'm unsure if gulp has --stack option. (probably unlikely)

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

Yup, everything is being watched (all 45 files), and also every changes that are done. It responds to it directly.

from gulp-watch.

floatdrop avatar floatdrop commented on August 18, 2024

That is strange. I cannot spend much time, because of my work, but it would be great if you test something for me: Could you replace watch({ glob: 'sass/**' }) with watch({ glob: 'sass/**', emitOnGlob: false, passThrough: false }) in gulpfile?

from gulp-watch.

dashed avatar dashed commented on August 18, 2024

I'm considering the possibility that gulp-sass might be the culprit. I haven't used it myself yet, but @floatdrop would would have more say on this since he has used it with gulp-watch.

I'm unsure what your gulpfile looks like at the moment.

from gulp-watch.

floatdrop avatar floatdrop commented on August 18, 2024

I'm pretty sure, this is cygwin playing with you, @marco3211. Easiest way out - use virtual machine to develop under Windows.

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

Yup no problem, I'll test it out, will let you know what's the outcome. I'll also start looking at virtualbox and get up and running with probably Ubuntu (or any other suggestions), if it still persists.

from gulp-watch.

marco3211 avatar marco3211 commented on August 18, 2024

@floatdrop no its not working. Yes you're right the error is probably something related to cygwin. Not sure what it is exactly though. I'll end up running my workspace on a virtual machine like you suggested.

Before closing the issue, I want to thank you and @dashed for the help and patience.

from gulp-watch.

floatdrop avatar floatdrop commented on August 18, 2024

Adjusted title to be more descriptive of what going on.

from gulp-watch.

junchendezuoji avatar junchendezuoji commented on August 18, 2024

到底怎么回事哟

from gulp-watch.

bruunas avatar bruunas commented on August 18, 2024

I had the same issue and was syntax incorrect.

from gulp-watch.

hualinIT avatar hualinIT commented on August 18, 2024

You can tell me how to solve this problem?
$ gulp
[10:54:13] Using gulpfile E:\conDep\web2\gulpfile.js
[10:54:13] Starting 'cleanPro'...
[10:54:13] Finished 'cleanPro' after 23 ms
[10:54:13] Starting 'revCss'...
[10:54:13] Starting 'copyMoveStatic'...
[10:54:13] Starting 'revJsLibs'...
[10:54:13] Starting 'revJsPlugins'...
[10:54:13] Starting 'revJsWebapps'...
[10:54:13] Starting 'revJsTpl'...
[10:54:13] Starting 'dealImg'...
[10:54:13] Finished 'revJsWebapps' after 191 ms
/c/Users/hualin/AppData/Roaming/npm/gulp: line 14: 1908 Illegal instruction node "$basedir/node_modules/gulp/bin/gulp.js" "$@"

from gulp-watch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.