Skip to content

Commit b53f903

Browse files
committed
use regex for plucking the path from stack
1 parent 0af70c2 commit b53f903

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-dev-utils/formatBuildError.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function formatBuildError(err) {
2121
console.log(
2222
'Failed to minify the code from \n\n',
2323
chalk.yellow(
24-
err.stack.split('\n')[1].split('[')[1].split('][')[0].replace(']', '')
24+
/Unexpected token:(.+)\[(.+)\]\[(.+)\]/.exec(err.stack)[2]
2525
),
2626
'\n'
2727
);

0 commit comments

Comments
 (0)