From d31895ecf30656f58929cdd3d74752e6687bc8b5 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Mon, 1 Jul 2024 10:54:05 +0200 Subject: [PATCH] update debug logs --- src/js/tools/metroconfig.ts | 1 + src/js/tools/sentryBabelTransformerUtils.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/tools/metroconfig.ts b/src/js/tools/metroconfig.ts index 9226cd647..6e5854475 100644 --- a/src/js/tools/metroconfig.ts +++ b/src/js/tools/metroconfig.ts @@ -104,6 +104,7 @@ export function withSentryBabelTransformer(config: MetroConfig): MetroConfig { logger.debug('Default Babel transformer path from `config.transformer`:', defaultBabelTransformerPath); if (!defaultBabelTransformerPath) { + // This has to be console.warn because the options is enabled but won't be used // eslint-disable-next-line no-console console.warn('`transformer.babelTransformerPath` is undefined.'); // eslint-disable-next-line no-console diff --git a/src/js/tools/sentryBabelTransformerUtils.ts b/src/js/tools/sentryBabelTransformerUtils.ts index e9a607141..db34e3428 100644 --- a/src/js/tools/sentryBabelTransformerUtils.ts +++ b/src/js/tools/sentryBabelTransformerUtils.ts @@ -44,6 +44,7 @@ export function cleanDefaultBabelTransformerPath(): void { } logger.debug('Cleaned default Babel transformer path'); } catch (e) { + // We don't want to fail the build if we can't clean the file // eslint-disable-next-line no-console console.error('[Sentry] Failed to clean default Babel transformer path:', e); } @@ -59,7 +60,7 @@ function getDefaultBabelTransformerPath(): string { export function loadDefaultBabelTransformer(): BabelTransformer { const defaultBabelTransformerPath = readDefaultBabelTransformerPath(); if (!defaultBabelTransformerPath) { - throw new Error('Default Babel transformer path not found'); + throw new Error('Default Babel Transformer Path not found in `.sentry` directory.'); } logger.debug(`Loading default Babel transformer from ${defaultBabelTransformerPath}`);