Skip to content

Commit b969fbf

Browse files
authored
(SP: 1) [FIX] Add netlify-plugin-bundle-env for Netlify SSR env var delivery (#426)
* perf(sessions): move heartbeat from DB writes to Redis sorted set fix(about): update LinkedIn follower fallback to 1800 * fix(db): require explicit APP_ENV and add runtime env diagnostics * fix(db): replace APP_ENV throw with runtime env diagnostics for Netlify debugging * fix(deploy): inline all server env vars at build time for Netlify SSR runtime * fix(deploy): add netlify-plugin-bundle-env to inject env vars into SSR runtime
1 parent 6e021de commit b969fbf

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

frontend/app/[locale]/layout.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { CookieBanner } from '@/components/shared/CookieBanner';
1010
import Footer from '@/components/shared/Footer';
1111
import { ScrollWatcher } from '@/components/shared/ScrollWatcher';
1212
import { ThemeProvider } from '@/components/theme/ThemeProvider';
13-
// import { getCachedBlogCategories } from '@/db/queries/blog/blog-categories';
13+
import { getCachedBlogCategories } from '@/db/queries/blog/blog-categories';
1414
import { AuthProvider } from '@/hooks/useAuth';
1515
import { locales } from '@/i18n/config';
1616

@@ -25,18 +25,10 @@ export default async function LocaleLayout({
2525

2626
if (!locales.includes(locale as any)) notFound();
2727

28-
// const [messages, blogCategories] = await Promise.all([
29-
// getMessages({ locale }),
30-
// getCachedBlogCategories(locale),
31-
// ]);
32-
33-
const messages = await getMessages({ locale });
34-
const blogCategories: Array<{
35-
id: string;
36-
slug: string;
37-
title: string;
38-
}> = [];
39-
28+
const [messages, blogCategories] = await Promise.all([
29+
getMessages({ locale }),
30+
getCachedBlogCategories(locale),
31+
]);
4032

4133
const enableAdmin =
4234
(

frontend/db/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if (process.env.NODE_ENV !== 'test') {
2626

2727
const IS_LOCAL_ENV = APP_ENV === 'local';
2828

29-
const STRICT_LOCAL_DB_GUARD = process.env.SHOP_STRICT_LOCAL_DB === '1';
29+
0const STRICT_LOCAL_DB_GUARD = process.env.SHOP_STRICT_LOCAL_DB === '1';
3030
const REQUIRED_LOCAL_DB_URL = process.env.SHOP_REQUIRED_DATABASE_URL_LOCAL;
3131

3232
if (STRICT_LOCAL_DB_GUARD) {

frontend/next.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import createNextIntlPlugin from 'next-intl/plugin';
55
const withNextIntl = createNextIntlPlugin('./i18n/request.ts');
66

77
const nextConfig: NextConfig = {
8-
env: {
9-
APP_ENV: process.env.APP_ENV,
10-
DATABASE_URL: process.env.DATABASE_URL,
11-
},
128
images: {
139
remotePatterns: [
1410
{

netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88

99
[[plugins]]
1010
package = "@netlify/plugin-nextjs"
11+
12+
[[plugins]]
13+
package = "netlify-plugin-bundle-env"

0 commit comments

Comments
 (0)