diff --git a/src/create-matcher.js b/src/create-matcher.js index ab62be430..4b3a766b2 100644 --- a/src/create-matcher.js +++ b/src/create-matcher.js @@ -185,7 +185,16 @@ function matchRoute ( for (let i = 1, len = m.length; i < len; ++i) { const key = regex.keys[i - 1] - const val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i] + let val = m[i] + if (typeof m[i] === 'string') { + try { + val = decodeURIComponent(m[i]) + } catch (error) { + if (error.toString() !== 'URIError: URI malformed') { + throw error + } + } + } if (key) { // Fix #1994: using * with props: true generates a param named 0 params[key.name || 'pathMatch'] = val diff --git a/src/history/errors.js b/src/history/errors.js index 21f3f56f9..2d624e135 100644 --- a/src/history/errors.js +++ b/src/history/errors.js @@ -48,9 +48,6 @@ function createRouterError (from, to, type, message) { error.to = to error.type = type - const newStack = error.stack.split('\n') - newStack.splice(1, 2) // remove 2 last useless calls - error.stack = newStack.join('\n') return error }