From 84fa6896869dd941b99178041f7774873194a55a Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Fri, 28 Aug 2026 09:41:09 +1000 Subject: [PATCH] fix(desktop): preserve lazy Sentry loading (#45776) --- packages/app/src/shell/errors/error.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 (