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

"Looking for Modernizr references" error #5

Closed
tarciozemel opened this issue Feb 25, 2014 · 1 comment
Closed

"Looking for Modernizr references" error #5

tarciozemel opened this issue Feb 25, 2014 · 1 comment

Comments

@tarciozemel
Copy link

I'm trying to use gulp-modernizr, but without success... Following the instructions, I installed it via npm (referencing the git repo, as descibed in #2) and put in my gulpfile.js:

gulp.task('modernizr', function() {
    gulp.src('[path]/js/*.js')
        .pipe(modernizr())
        .pipe(gulp.dest([path])); // In README this line is wrong, just "dest()"
});

But I'm always getting this error (trying watch or run directly with gulp modernizr):

Looking for Modernizr references

[...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:242
                        throw error;
                              ^
TypeError: Cannot read property 'length' of undefined
    at Object.parseCodeFromBuffers ([...]/node_modules/gulp-modernizr/node_modules/customizr/src/crawler.js:152:27)
    at Object.init ([...]/node_modules/gulp-modernizr/node_modules/customizr/src/crawler.js:241:18)
    at next ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:584:17)
    at notify ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:201:22)
    at Deferred.then.promise.then ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:262:4)
    at Object.exports.when ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:364:20)
    at next ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:584:12)
    at Object.exports.seq ([...]/node_modules/gulp-modernizr/node_modules/customizr/node_modules/promised-io/promise.js:592:2)
    at Object.Customizr.init ([...]/node_modules/gulp-modernizr/node_modules/customizr/src/index.js:26:12)
    at Object.Customizr ([...]/node_modules/gulp-modernizr/node_modules/customizr/src/index.js:16:15)

In which point I'm writing wrong code?

Regards!

@doctyper
Copy link
Member

The error occurs when no buffers are found. This means the path you defined in gulp.src() is not finding any files to parse.

I've updated gulp-modernizr to fail silently when this occurs in df487c6

Update via: npm install gulp-modernizr@https://github.com/doctyper/gulp-modernizr/tarball/develop

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