From aa207b4f56e49bbc48eb8317164ed01093b2310a Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> Date: Sun, 18 Jun 2023 15:12:03 -0400 Subject: [PATCH] Fix longstanding issue TypeError: e.map is not a function (#5170) Fixes #4868 This took so long to track down. I am convinced `@ts-expect-error` is *always an error*. --- static/panes/editor.ts | 24 +++++++----------------- static/panes/executor.ts | 3 +-- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/static/panes/editor.ts b/static/panes/editor.ts index 59e17c27a..6b838ac14 100644 --- a/static/panes/editor.ts +++ b/static/panes/editor.ts @@ -56,8 +56,6 @@ import ICursorSelectionChangedEvent = editor.ICursorSelectionChangedEvent; import {Compiler} from './compiler.js'; import {assert, unwrap} from '../assert.js'; -import * as Sentry from '@sentry/browser'; - const loadSave = new loadSaveLib.LoadSave(); const languages = options.languages; @@ -1430,16 +1428,8 @@ export class Editor extends MonacoPane { return { sourcePane: sourcePane, @@ -1459,21 +1449,21 @@ export class Editor extends MonacoPane { - all = all.concat(this.addSource(step.stdout, compilerTitle, result)); - all = all.concat(this.addSource(step.stderr, compilerTitle, result)); + all = all.concat(this.addSource(step.stdout, compilerTitle)); + all = all.concat(this.addSource(step.stderr, compilerTitle)); }); } if (result.tools) { _.each(result.tools, tool => { - all = all.concat(this.addSource(tool.stdout, tool.name + ' #' + compilerId, result)); - all = all.concat(this.addSource(tool.stderr, tool.name + ' #' + compilerId, result)); + all = all.concat(this.addSource(tool.stdout, tool.name + ' #' + compilerId)); + all = all.concat(this.addSource(tool.stderr, tool.name + ' #' + compilerId)); }); } - all = all.concat(this.addSource(result.stderr, compilerTitle, result)); + all = all.concat(this.addSource(result.stderr, compilerTitle)); return all; } diff --git a/static/panes/executor.ts b/static/panes/executor.ts index 7f4170fd5..92376af33 100644 --- a/static/panes/executor.ts +++ b/static/panes/executor.ts @@ -262,8 +262,7 @@ export class Executor extends Pane { } private errorResult(message: string): CompilationResult { - // @ts-expect-error: This is a valid CompilationResult - return {stdout: [], timedOut: false, code: -1, stderr: message}; + return {stdout: [], timedOut: false, code: -1, stderr: [{text: message}]}; } compile(bypassCache?: BypassCache): void {