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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With