We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 029e8bd commit 9e9b54dCopy full SHA for 9e9b54d
1 file changed
compiler/packages/babel-plugin-react-compiler/src/CompilerError.ts
@@ -188,6 +188,7 @@ export class CompilerError extends Error {
188
constructor(...args: Array<any>) {
189
super(...args);
190
this.name = 'ReactCompilerError';
191
+ this.details = [];
192
}
193
194
override get message(): string {
@@ -197,7 +198,10 @@ export class CompilerError extends Error {
197
198
override set message(_message: string) {}
199
200
override toString(): string {
- return this.details.map(detail => detail.toString()).join('\n\n');
201
+ if (Array.isArray(this.details)) {
202
+ return this.details.map(detail => detail.toString()).join('\n\n');
203
+ }
204
+ return this.name;
205
206
207
push(options: CompilerErrorDetailOptions): CompilerErrorDetail {
0 commit comments