Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error if gulp.src has negated paths #33

Closed
jaichandra opened this issue Aug 26, 2016 · 2 comments
Closed

error if gulp.src has negated paths #33

jaichandra opened this issue Aug 26, 2016 · 2 comments

Comments

@jaichandra
Copy link

Below code throws error:

gulp.src(['src/**/*.html', '!src/**/test/*.html'])
            .pipe(template({
                includes: '<script>....</script>'
            }))
            .pipe(gulp.dest(destination));

Error:

events.js:160
      throw er; // Unhandled 'error' event
      ^
ReferenceError: data is not defined
    at eval (lodash.templateSources[5]:10:4)
    at DestroyableTransform._transform (/Users/.../node_modules/gulp-template/index.js:22:40)
    at DestroyableTransform.Transform._read (/Users/.../node_modules/gulp-template/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/Users/.../node_modules/gulp-template/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (/Users/.../node_modules/gulp-template/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (/Users/.../node_modules/gulp-template/node_modules/readable-stream/lib/_stream_writable.js:302:5)
    at DestroyableTransform.Writable.write (/Users/.../node_modules/gulp-template/node_modules/readable-stream/lib/_stream_writable.js:241:11)
    at write (/Users/.../node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/Users/.../node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/Users/.../node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)

@sindresorhus
Copy link
Owner

I don't think it's because of negated files. More likely it's not matching any files then. Try using https://github.com/sindresorhus/gulp-debug to see what files are passing through it.

@jaichandra
Copy link
Author

@sindresorhus sorry about that. It was an issue with one of the files. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants