diff --git a/lib/telemetry/src/index.ts b/lib/telemetry/src/index.ts index 1b00c7f2bf5e..864a66828577 100644 --- a/lib/telemetry/src/index.ts +++ b/lib/telemetry/src/index.ts @@ -28,7 +28,7 @@ export const telemetry = async ( telemetryData.payload.error = sanitizeError(error); } - if (!telemetryData.payload.error || options.enableCrashReports) { + if (!telemetryData.payload.error || options?.enableCrashReports) { if (process.env?.STORYBOOK_DEBUG_TELEMETRY) { logger.info('\n[telemetry]'); logger.info(JSON.stringify(telemetryData, null, 2));