From db7c8925b110608d00968ce40797c80b64525fa3 Mon Sep 17 00:00:00 2001 From: Tim Cosgrove Date: Mon, 30 Sep 2024 10:11:23 -0700 Subject: [PATCH 1/2] Debug env vars on prod. --- packages/env-loader/src/cms-feature-flags.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/env-loader/src/cms-feature-flags.ts b/packages/env-loader/src/cms-feature-flags.ts index b504133a7..01405ae75 100644 --- a/packages/env-loader/src/cms-feature-flags.ts +++ b/packages/env-loader/src/cms-feature-flags.ts @@ -8,6 +8,10 @@ export const getCmsFeatureFlags = async ( drupalBaseUrl: string, debug: boolean = false ): Promise => { + // eslint-disable-next-line no-console + console.log('about to dump GTM value for debugging.') + // eslint-disable-next-line no-console + console.log(process.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID) const fetcher = getFetcher(drupalBaseUrl, debug) const featureFlagUrl = `${removeTrailingSlash(drupalBaseUrl)}/flags_list` const response = await fetcher(featureFlagUrl) From 99cbe701bd9a79f244d3c19363ae98fd0d814f8b Mon Sep 17 00:00:00 2001 From: Tim Cosgrove Date: Mon, 30 Sep 2024 10:55:14 -0700 Subject: [PATCH 2/2] Add more debug output. --- docker-run.sh | 2 +- packages/env-loader/src/env-file.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-run.sh b/docker-run.sh index b0ffe6b08..1e12f44bc 100644 --- a/docker-run.sh +++ b/docker-run.sh @@ -1,3 +1,3 @@ #!/bin/sh - +ls -al envs APP_ENV=$APP_ENV yarn build:preview && yarn start diff --git a/packages/env-loader/src/env-file.ts b/packages/env-loader/src/env-file.ts index 9a80ddea3..d1e27b907 100644 --- a/packages/env-loader/src/env-file.ts +++ b/packages/env-loader/src/env-file.ts @@ -22,7 +22,11 @@ const loadEnvVarsFromPath = (path: string): EnvVars => { export const getEnvFileVars = (appEnv?: string): EnvVars => { // Load env vars from `.env.${process.env.APP_ENV}` if it exists, // otherwise load env vars from `.env.local` if it exists. + // eslint-disable-next-line no-console + console.log(`appEnv is ${appEnv}`) if (appEnv && fs.existsSync(`envs/.env.${appEnv}`)) { + // eslint-disable-next-line no-console + console.log(`we are trying to read envs/.env.${appEnv}`) return loadEnvVarsFromPath(`envs/.env.${appEnv}`) } else if (fs.existsSync('envs/.env.local')) { return loadEnvVarsFromPath(`envs/.env.local`)