5

I'm running a Node App project built on Express, Jade and Less. I'm using 'Gulp' (The streaming build system) along with 'browserify' and 'gulp-browserify'. But when I run Gulp Task its throwing error showing like

[gulp] SyntaxError in plugin 'gulp-browserify': <my_project_path>/assets/javascripts/fake_a3100e75.js 

The file fake_a3100e75.js does not seem to exists in directory.

Has anybody come across the same problem? Any solutions highly appreciated?

1 Answer 1

6

gulp-browserify isn't a recommended plugin. Its actually blacklisted. This is because Browserify handles its own I/O operations and returns a stream itself, so there's no need for gulp.src(). Instead use Browserify or Watchify directly along with vinyl-source-stream to stream it into other plugins. There's a recipe in the docs here.

There's also a good recipe for handling errors.

Here's what the task I'm working on looks like right now.

Your error pointed to a fake filename because that's what gulp-browserify names the file in a vinyl stream. With the recipes above you name the file yourself with vinyl-source-stream, and that's after the error handler is set on browserify, so you should get proper browserify errors.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.