2 Commits
Author SHA1 Message Date
asepharyana f4fb43c1a5 fix(config): don't throw on missing DATABASE_URL at import time
CI / typecheck + build (turbo) (push) Canceled after 0s
The import-time guard broke 'next build' (SSG data collection imports
@mcpedia/config before any .env exists) and any runtime-injected env.
postgres.js connects lazily on first query, so a missing DATABASE_URL now
surfaces as a clear connect error at runtime instead of a cryptic build
failure. Lets CI build without .env present.
2026-08-19 22:49:03 +07:00
asepharyana c7697666fe fix(web): remove stray create-next-app layout.tsx (LayoutProps<'/'> removed in Next 16)
The file sat outside app/ so next build ignored it, but turbo typecheck's
tsc compiles all *.tsx and failed on the Next-15-only LayoutProps type.
The real layout is apps/web/app/layout.tsx. Deleting the dead scaffold
lets CI typecheck pass.
2026-08-19 22:46:14 +07:00
2 changed files with 6 additions and 35 deletions

No files matched your search

-29
View File
@@ -1,29 +0,0 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({ children }: LayoutProps<"/">) {
return (
<html
lang="en"
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
>
<body className="min-h-full flex flex-col">{children}</body>
</html>
);
}
+6 -6
View File
@@ -50,9 +50,9 @@ export const QUEUE_PREFIX = process.env.QUEUE_PREFIX ?? "mcpedia";
// this header (x-webhook-secret) to match, so an open port can't trigger reindex. // this header (x-webhook-secret) to match, so an open port can't trigger reindex.
export const WEBHOOK_SECRET = process.env.WEBHOOK_SECRET ?? ""; export const WEBHOOK_SECRET = process.env.WEBHOOK_SECRET ?? "";
if (!DATABASE_URL) { // NOTE: we deliberately do NOT throw here if DATABASE_URL is empty. Throwing at
// Fail fast with an explicit message instead of a cryptic driver error. // import time breaks `next build` (SSG data collection imports config before
throw new Error( // any .env is present) and any runtime-injected env (containers/systemd set env
"DATABASE_URL is not set. Copy .env.example to .env and set it (dev uses imrnes Postgres :6432).", // at process start, after module load). The DB driver (postgres.js) connects
); // lazily on first query, so a missing DATABASE_URL surfaces as a clear connect
} // error at runtime — not a cryptic build failure.