Skip to content

Commit 1917270

Browse files
authoredMay 16, 2018
Merge pull request #351 from menzow/feature/update-docs
Add troubleshooting information for silenced errors
2 parents d232754 + 8147bc5 commit 1917270

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed
 

‎readme.markdown

+17-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ b.on('update', bundle);
134134
bundle();
135135

136136
function bundle() {
137-
b.bundle().pipe(fs.createWriteStream('output.js'));
137+
b.bundle()
138+
.on('error', console.error)
139+
.pipe(fs.createWriteStream('output.js'))
140+
;
138141
}
139142
```
140143

@@ -242,6 +245,19 @@ and [stackoverflow](http://stackoverflow.com/questions/26708205/webpack-watch-is
242245
Try the `--poll` flag
243246
and/or renaming the project's directory - that might help.
244247

248+
## watchify swallows errors
249+
250+
To ensure errors are reported you have to add a event listener to your bundle stream. For more information see ([browserify/browserify#1487 (comment)](https://github.com/browserify/browserify/issues/1487#issuecomment-173357516) and [stackoverflow](https://stackoverflow.com/a/22389498/1423220))
251+
252+
**Example:**
253+
```
254+
var b = browserify();
255+
b.bundle()
256+
.on('error', console.error)
257+
...
258+
;
259+
```
260+
245261
# see also
246262

247263
- [budo](https://www.npmjs.com/package/budo) – a simple development server built on watchify

0 commit comments

Comments
 (0)
Please sign in to comment.