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

When using gulp-requirejs, getting error "Expected a source file with stats" #29

Open
Sawtaytoes opened this issue Jan 13, 2016 · 3 comments

Comments

@Sawtaytoes
Copy link

When I am using gulp-requirejs as my src instead of gulp.src(), I get the error "Expected a source file with stats". Originally thought this is because the file didn't exist, but it looks like it might be something weird about how gulp-requirejs() puts files through the stream.

package.json

"gulp-requirejs": "^0.1.3",

gulpfile.js

rjs({
    baseUrl: baseDir,
    name: moduleMain,
    out: outputFile,
    paths: {'Scripts': 'empty:'},
    insertRequire: views,
    include: views,
    inlineText: true,
    excludeShallow: ['text']
})
.pipe(newer(baseDir + moduleMain + '/' + outputFile))
.pipe(gulp.dest(outputDir))
@AntonioRedondo
Copy link

The same issue happens when using Browserify:

gulp.task('buildJs', () => {
    return browserify({
        entries: `${SRC}/react/index.jsx`
    }).bundle()
        .pipe(newer(`${DEST}/bundle.js`))
        .pipe(vinylSource('bundle.js'))
        .pipe(gulp.dest(DEST));
});

If I remove .pipe(newer(`${DEST}/bundle.js`)) the Gulp task works as usual.

@AntonioRedondo
Copy link

OK, I just saw this: #42. For those who want to use newer with Browserify newer's author recommends to use Watchify instead.

@matteusbarbosa
Copy link

Guys for me the case ended with a different approach

install node latest version
*install the updated node-sass (if you use it)
install gulp-changed and discard gulp-newer for the moment

after doing these 3 steps I got my tasks working again

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

3 participants