Skip to content

Commit

Permalink
fix: RollupLog cause allow unknown (#4757)
Browse files Browse the repository at this point in the history
* fix: RollupLog cause allow unknown

* fix access to cause.name

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
  • Loading branch information
Shinigami92 and lukastaegert committed Dec 17, 2022
1 parent a27cf81 commit 554ba9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/logging.ts
Expand Up @@ -8,7 +8,7 @@ export const stderr = (...parameters: readonly unknown[]) =>
process.stderr.write(`${parameters.join('')}\n`);

export function handleError(error: RollupError, recover = false): void {
const name = error.name || error.cause?.name;
const name = error.name || (error.cause as Error)?.name;
const nameSection = name ? `${name}: ` : '';
const pluginSection = error.plugin ? `(plugin ${error.plugin}) ` : '';
const message = `${pluginSection}${nameSection}${error.message}`;
Expand Down
2 changes: 1 addition & 1 deletion src/rollup/types.d.ts
Expand Up @@ -19,7 +19,7 @@ export type RollupWarning = RollupLog;

export interface RollupLog {
binding?: string;
cause?: Error;
cause?: unknown;
code?: string;
exporter?: string;
frame?: string;
Expand Down

0 comments on commit 554ba9f

Please sign in to comment.