diff --git a/cli/logging.ts b/cli/logging.ts index aeb1f9e3770..964a6a8e348 100644 --- a/cli/logging.ts +++ b/cli/logging.ts @@ -30,7 +30,7 @@ export function handleError(error: RollupError, recover = false): void { } if (error.stack) { - stderr(dim(error.stack)); + stderr(dim(error.stack.replace(`${nameSection}${error.message}\n`, ''))); } stderr(''); diff --git a/test/cli/samples/custom-frame-with-pos/_config.js b/test/cli/samples/custom-frame-with-pos/_config.js index e778c6418a4..2af0a903e4d 100644 --- a/test/cli/samples/custom-frame-with-pos/_config.js +++ b/test/cli/samples/custom-frame-with-pos/_config.js @@ -7,9 +7,6 @@ module.exports = { stderr: stderr => assertIncludes( stderr, - '[!] (plugin at position 1) Error: My error.\n' + - 'main.js (1:5)\n' + - 'custom code frame\n' + - 'Error: My error.' + '[!] (plugin at position 1) Error: My error.\n' + 'main.js (1:5)\n' + 'custom code frame\n' ) }; diff --git a/test/cli/samples/custom-frame/_config.js b/test/cli/samples/custom-frame/_config.js index 6754f50bfe2..bd3f7c35c69 100644 --- a/test/cli/samples/custom-frame/_config.js +++ b/test/cli/samples/custom-frame/_config.js @@ -8,7 +8,7 @@ module.exports = { assertIncludes( stderr, '[!] (plugin at position 1) Error: My error.\n' + - 'main.js\ncustom code frame\nError: My error.\n' + + 'main.js\ncustom code frame\n' + ' at Object.' ); assertIncludes(stderr, 'rollup.config.js:9:19');