From 10db8acea46eec94b77bcb47f95edcaaea24c995 Mon Sep 17 00:00:00 2001 From: Zalmoxisus Date: Sun, 20 Dec 2015 20:15:21 +0200 Subject: [PATCH] Solve the issue with loosing sourceMaps in Chrome Fix #193. --- src/instrument.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/instrument.js b/src/instrument.js index 8885c1fa..8006e597 100644 --- a/src/instrument.js +++ b/src/instrument.js @@ -67,7 +67,10 @@ function computeNextEntry(reducer, action, state, error) { nextState = reducer(state, action); } catch (err) { nextError = err.toString(); - console.error(err.stack || err); + if (typeof window === 'object' && typeof window.chrome !== 'undefined') { + // Solve the issue with loosing sourceMaps in Chrome + setTimeout(() => { throw err; }, 0); + } else console.error(err.stack || err); } return {