diff --git a/packages/app/src/shell/errors/error.tsx b/packages/app/src/shell/errors/error.tsx index f4d677b5db0..69ef5477d29 100644 --- a/packages/app/src/shell/errors/error.tsx +++ b/packages/app/src/shell/errors/error.tsx @@ -1,5 +1,5 @@ import { TextField } from "@opencode-ai/ui/text-field" -import { captureException, isEnabled } from "@sentry/solid" +import type { captureException } from "@sentry/solid" import { Logo } from "@opencode-ai/ui/logo" import { Button } from "@opencode-ai/ui/button" import { Component, createSignal, onMount, Show } from "solid-js" @@ -227,6 +227,7 @@ export const ErrorPage: Component = (props) => { let recordedFatalError: Promise | undefined const [store, setStore] = createStore({ actionError: undefined as string | undefined, + captureException: undefined as typeof captureException | undefined, }) function ensureFatalErrorRecorded() { @@ -243,6 +244,11 @@ export const ErrorPage: Component = (props) => { onMount(() => { void ensureFatalErrorRecorded().catch(() => undefined) + void import("@sentry/solid") + .then(({ captureException, isEnabled }) => { + if (isEnabled()) setStore("captureException", () => captureException) + }) + .catch(() => undefined) }) async function checkForUpdates() { @@ -311,15 +317,15 @@ export const ErrorPage: Component = (props) => { {language.t("error.page.action.exportLogs")} - - {(_) => { + + {(capture) => { const [reported, setReported] = createSignal(false) return (