diff --git a/apps/dashboard/src/instrumentation-node.ts b/apps/dashboard/src/instrumentation-node.ts index 54e502d72..cdd8b6cda 100644 --- a/apps/dashboard/src/instrumentation-node.ts +++ b/apps/dashboard/src/instrumentation-node.ts @@ -1,9 +1,9 @@ import "server-only"; -import { getEnvVariable } from "@hexclave/shared/dist/utils/env"; +import { getEnvBoolean } from "@hexclave/shared/dist/utils/env"; export async function startRemoteDevelopmentEnvironmentLifecycleIfNeeded(): Promise { - if (getEnvVariable("NEXT_PUBLIC_STACK_IS_REMOTE_DEVELOPMENT_ENVIRONMENT", "") !== "true") { + if (!getEnvBoolean("NEXT_PUBLIC_STACK_IS_REMOTE_DEVELOPMENT_ENVIRONMENT")) { return; } diff --git a/apps/dashboard/src/instrumentation.ts b/apps/dashboard/src/instrumentation.ts index 599b21498..beaed1a12 100644 --- a/apps/dashboard/src/instrumentation.ts +++ b/apps/dashboard/src/instrumentation.ts @@ -31,8 +31,10 @@ export async function register(): Promise { let nicified; try { nicified = nicify(error, { maxDepth: 8 }); - } catch (e) { - nicified = `Error occurred during nicification: ${e}`; + } catch (nicifyError: unknown) { + // Only nicify errors are converted to metadata; the original event still reports. + const nicifyErrorMessage = nicifyError instanceof Error ? nicifyError.message : String(nicifyError); + nicified = `Error occurred during nicification: ${nicifyErrorMessage}`; } if (error instanceof Error) { event.extra = {