From d38ee11a16ee0b7b1839a1adb8921deb6cfe630a Mon Sep 17 00:00:00 2001 From: "joseph.sawaya@sentry.io" Date: Fri, 24 Jul 2026 23:42:13 +0000 Subject: [PATCH] fix(explore): Ensure variadic field and environment flags are arrays --- src/commands/explore.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/commands/explore.ts b/src/commands/explore.ts index 6e401e8f32..6601b24623 100644 --- a/src/commands/explore.ts +++ b/src/commands/explore.ts @@ -710,13 +710,19 @@ export const exploreCommand = buildListCommand("explore", { ); let dataset = flags.dataset; - const userSuppliedFields = flags.field && flags.field.length > 0; + const rawField = flags.field + ? ([] as string[]).concat(flags.field) + : undefined; + const userSuppliedFields = rawField && rawField.length > 0; let fieldList = [...defaultFieldsForDataset(dataset)]; if (userSuppliedFields) { - fieldList = flags.field; + fieldList = rawField; } const timeRange = flags.period; - const environment = parseReplayEnvironmentFilter(flags.environment); + const rawEnvironment = flags.environment + ? ([] as string[]).concat(flags.environment) + : undefined; + const environment = parseReplayEnvironmentFilter(rawEnvironment); // --metric auto mode: resolve metric name → tracemetrics aggregate if (flags.metric) {