mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Toolkit: return original stack trace for webpack errors (#37814)
This commit is contained in:
parent
5c69f899b5
commit
10cc9bda74
@ -57,17 +57,19 @@ export const bundlePlugin = async ({ watch, production, preserveConsole }: Plugi
|
||||
} else {
|
||||
compiler.run((err: Error, stats: webpack.Stats) => {
|
||||
if (err) {
|
||||
reject(err.message);
|
||||
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
stats.compilation.errors.forEach((e) => {
|
||||
console.log(e.message);
|
||||
});
|
||||
|
||||
reject('Build failed');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('\n', stats.toString({ colors: true }), '\n');
|
||||
resolve();
|
||||
});
|
||||
|
@ -11,7 +11,8 @@ export const useSpinner = async (label: string, fn: () => Promise<any>, killProc
|
||||
|
||||
if (err.stdout) {
|
||||
console.error(err.stdout);
|
||||
} else {
|
||||
} else if (err.message) {
|
||||
// Return stack trace if error object
|
||||
console.trace(err); // eslint-disable-line no-console
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user