Skip to content

Commit 8147bc5

Browse files
committedNov 17, 2017
Add troubleshooting information for silenced errors
1 parent cf05baa commit 8147bc5

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

@@ -221,6 +224,19 @@ and [stackoverflow](http://stackoverflow.com/questions/26708205/webpack-watch-is
221224
Try the `--poll` flag
222225
and/or renaming the project's directory - that might help.
223226

227+
## watchify swallows errors
228+
229+
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))
230+
231+
**Example:**
232+
```
233+
var b = browserify();
234+
b.bundle()
235+
.on('error', console.error)
236+
...
237+
;
238+
```
239+
224240
# see also
225241

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

0 commit comments

Comments
 (0)
Please sign in to comment.