From f8abe4e21f4361b35d82ee7ddcde137aa42b56c8 Mon Sep 17 00:00:00 2001 From: Tianzhou Chen Date: Thu, 27 Jul 2023 01:34:39 +0800 Subject: [PATCH] chore: add a log to printout NEXT_PUBLIC env --- src/pages/_app.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 32f6c7f..f0f240d 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -23,6 +23,10 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: AppProps<{ s const { i18n } = useTranslation(); const settingStore = useSettingStore(); + // Check whether those NEXT_PUBLIC_ envs are properly exposed in frontend. + // See https://github.com/vercel/next.js/discussions/17641 + console.log("Use database:", process.env.NEXT_PUBLIC_DATABASE_LESS); + useEffect(() => { const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)"); const handleColorSchemeChange = (e: MediaQueryListEvent) => {