Skip to content

Commit a1d5b22

Browse files
committed
throw error in ssr so it can be captured properly by renderer
1 parent 3c0cdb5 commit a1d5b22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/util/error.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import config from '../config'
22
import { warn } from './debug'
3+
import { inBrowser } from './env'
34

45
export function handleError (err, vm, type) {
56
if (config.errorHandler) {
@@ -8,8 +9,10 @@ export function handleError (err, vm, type) {
89
if (process.env.NODE_ENV !== 'production') {
910
warn(`Error in ${type}:`, vm)
1011
}
11-
if (typeof console !== 'undefined') {
12+
if (inBrowser && typeof console !== 'undefined') {
1213
console.error(err)
14+
} else {
15+
throw err
1316
}
1417
}
1518
}

0 commit comments

Comments
 (0)