From 2c35317c5934462c2e195372634980a46ff5cdef Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 15:12:38 +0900 Subject: [PATCH 01/16] web: attempt to fix 500 error in prod --- apps/web/netlify.toml | 4 ++++ apps/web/netlify/edge-functions/og.tsx | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 5570c05619..a1cde1be50 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -6,6 +6,10 @@ publish = "apps/web/dist/client" VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22" +[[edge_functions]] +function = "og" +path = "/og" + [images] # https://docs.netlify.com/build/image-cdn/overview/#remote-path remote_images = [ diff --git a/apps/web/netlify/edge-functions/og.tsx b/apps/web/netlify/edge-functions/og.tsx index 45b90d0e6f..aa08daa4d2 100644 --- a/apps/web/netlify/edge-functions/og.tsx +++ b/apps/web/netlify/edge-functions/og.tsx @@ -100,9 +100,3 @@ export default function handler(req: Request) { // https://unpic.pics/og-edge return new ImageResponse(renderTemplate(params)); } - -// https://docs.netlify.com/build/edge-functions/declarations/#declare-edge-functions-inline -export const config = { - path: "/og", - cache: "manual", -}; From 22546b888e58ac991db73903ab36e7f386f8cb53 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 15:26:58 +0900 Subject: [PATCH 02/16] Make Netlify build work from monorepo root Adjust Netlify config and OG edge function imports to support running installs/builds from the monorepo root. The netlify.toml now sets base to apps/web and publishes from the package-relative dist/client so builds run correctly when executed from the repository root. Updated edge function file to use deno-lint ignore-file, add React JSX import source and import React to ensure correct JSX handling in Deno/ESM environment. --- apps/web/netlify.toml | 3 ++- apps/web/netlify/edge-functions/og.tsx | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index a1cde1be50..336c1780ae 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,6 +1,7 @@ [build] +base = "apps/web" command = "pnpm -F @hypr/web build" -publish = "apps/web/dist/client" +publish = "dist/client" [build.environment] VITE_APP_URL = "https://hyprnote.com" diff --git a/apps/web/netlify/edge-functions/og.tsx b/apps/web/netlify/edge-functions/og.tsx index aa08daa4d2..fde0a4d494 100644 --- a/apps/web/netlify/edge-functions/og.tsx +++ b/apps/web/netlify/edge-functions/og.tsx @@ -1,7 +1,8 @@ -// deno-lint-ignore no-import-prefix +// deno-lint-ignore-file no-import-prefix +/** @jsxImportSource https://esm.sh/react@18.2.0 */ import { ImageResponse } from "https://deno.land/x/og_edge@0.0.6/mod.ts"; -// deno-lint-ignore no-import-prefix import { z } from "https://deno.land/x/zod@v3.23.8/mod.ts"; +import React from "https://esm.sh/react@18.2.0"; const templateSchema = z.object({ type: z.literal("meeting"), From 3553ec5f22d5f67f9adfc0da3a67040a997307c3 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 15:28:24 +0900 Subject: [PATCH 03/16] Remove redundant React import in OG edge function Remove the unnecessary default React import since the file uses the @jsxImportSource pragma to pull React from esm.sh. This avoids a duplicate import of the same React build and cleans up the edge function code. - Deleted "import React from \"https://esm.sh/react@18.2.0\";" because /** @jsxImportSource https://esm.sh/react@18.2.0 */ already provides the JSX runtime. - Keeps deno.land imports (og_edge, zod) unchanged to use Deno-native modules. --- apps/web/netlify/edge-functions/og.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/netlify/edge-functions/og.tsx b/apps/web/netlify/edge-functions/og.tsx index fde0a4d494..a9574aa425 100644 --- a/apps/web/netlify/edge-functions/og.tsx +++ b/apps/web/netlify/edge-functions/og.tsx @@ -2,7 +2,6 @@ /** @jsxImportSource https://esm.sh/react@18.2.0 */ import { ImageResponse } from "https://deno.land/x/og_edge@0.0.6/mod.ts"; import { z } from "https://deno.land/x/zod@v3.23.8/mod.ts"; -import React from "https://esm.sh/react@18.2.0"; const templateSchema = z.object({ type: z.literal("meeting"), From 9ca2c7a91a94a1d0a359c34f877cbf3bc11aff30 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 15:40:24 +0900 Subject: [PATCH 04/16] Configure Netlify functions directory Add a [functions] directory setting to apps/web/netlify.toml pointing to the generated .netlify/v1/functions so Netlify can find the built server functions. The build previously produced apps/web/dist/server/server.js (and .netlify/v1/functions/server.mjs was generated) but Netlify wasn't detecting the functions directory, causing functions to be reported as targeting a non-existing directory. This change ensures Netlify looks for functions in .netlify/v1/functions and preserves the existing edge_functions configuration for /og. --- apps/web/netlify.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 336c1780ae..8694ddaaa0 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -7,6 +7,9 @@ publish = "dist/client" VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22" +[functions] +directory = ".netlify/v1/functions" + [[edge_functions]] function = "og" path = "/og" From c78d963754409122e915102f62f3e1f974ee08d5 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 15:41:30 +0900 Subject: [PATCH 05/16] chores --- .vscode/settings.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 794d579bcf..e83909b2cc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "explorer.excludeGitIgnore": true, "search.useParentIgnoreFiles": true, "search.useIgnoreFiles": true, "files.watcherExclude": { From 5725cd17d9908c6c87bcb548b7aaa3cd37c55cfd Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 15:47:14 +0900 Subject: [PATCH 06/16] Fix Netlify build config for web app Remove incorrect or redundant build settings in apps/web/netlify.toml to resolve runtime errors caused by misconfigured Netlify function paths. The change cleans up the [build] section by removing a stray base line and eliminates the [functions] directory entry that pointed to a non-existent or incompatible functions path. This aligns the manifest with the actual project layout and helps prevent server errors (like the reported 500 with getRouter undefined) caused by wrong publish/function configuration. --- apps/web/netlify.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 8694ddaaa0..e8c4fcabb3 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,5 +1,4 @@ [build] -base = "apps/web" command = "pnpm -F @hypr/web build" publish = "dist/client" @@ -7,9 +6,6 @@ publish = "dist/client" VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22" -[functions] -directory = ".netlify/v1/functions" - [[edge_functions]] function = "og" path = "/og" From 5b2385d367fa2e5f3ecb87013d7c0455eecd7971 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 15:51:50 +0900 Subject: [PATCH 07/16] wip --- apps/web/netlify.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index e8c4fcabb3..585afe40d9 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,7 +1,3 @@ -[build] -command = "pnpm -F @hypr/web build" -publish = "dist/client" - [build.environment] VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22" From 3e0748169b6ba5679b30549c5c9c8ae143538fb5 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:01:16 +0900 Subject: [PATCH 08/16] wip --- apps/web/netlify.toml | 16 ++++++++++++---- apps/web/netlify/edge-functions/og.tsx | 6 ++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 585afe40d9..03d0a47478 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,11 +1,19 @@ +[build] +base = "/" +package = "apps/web" +publish = "apps/web/dist/client" +# https://docs.netlify.com/build/edge-functions/optional-configuration/#edge-functions-directory +edge_functions = "apps/web/netlify/edge-functions" +command = "pnpm -F @hypr/web build" + +[functions] +# https://docs.netlify.com/build/functions/optional-configuration/?data-tab=TypeScript +directory = "apps/web/.netlify/v1/functions" + [build.environment] VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22" -[[edge_functions]] -function = "og" -path = "/og" - [images] # https://docs.netlify.com/build/image-cdn/overview/#remote-path remote_images = [ diff --git a/apps/web/netlify/edge-functions/og.tsx b/apps/web/netlify/edge-functions/og.tsx index a9574aa425..15cc4ee8e3 100644 --- a/apps/web/netlify/edge-functions/og.tsx +++ b/apps/web/netlify/edge-functions/og.tsx @@ -100,3 +100,9 @@ export default function handler(req: Request) { // https://unpic.pics/og-edge return new ImageResponse(renderTemplate(params)); } + +// https://docs.netlify.com/build/edge-functions/declarations/#declare-edge-functions-inline +export const config = { + path: "/og", + cache: "manual", +}; From 3bdc61f82943acf1aaace533e6f133b4f7ac3b24 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:13:14 +0900 Subject: [PATCH 09/16] update vite plugin order --- apps/web/vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index fc8b0edb0f..2966f5d8a8 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -8,7 +8,6 @@ import viteTsConfigPaths from "vite-tsconfig-paths"; const config = defineConfig(() => ({ plugins: [ - netlify({ dev: { images: { enabled: true } } }), contentCollections(), viteTsConfigPaths({ projects: ["./tsconfig.json"] }), tailwindcss(), @@ -30,6 +29,7 @@ const config = defineConfig(() => ({ }, }), viteReact(), + netlify({ dev: { images: { enabled: true } } }), ], ssr: { noExternal: ["posthog-js", "@posthog/react"], From 6f0df79e8cf048df15e3f10808e380bd2fcb7a72 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:23:45 +0900 Subject: [PATCH 10/16] wip --- apps/web/netlify.toml | 7 +++++-- apps/web/netlify/edge-functions/og.tsx | 6 ------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 03d0a47478..f39ddb0a9d 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,15 +1,18 @@ +# https://docs.netlify.com/build/configure-builds/file-based-configuration/#build-settings [build] base = "/" package = "apps/web" publish = "apps/web/dist/client" -# https://docs.netlify.com/build/edge-functions/optional-configuration/#edge-functions-directory -edge_functions = "apps/web/netlify/edge-functions" command = "pnpm -F @hypr/web build" [functions] # https://docs.netlify.com/build/functions/optional-configuration/?data-tab=TypeScript directory = "apps/web/.netlify/v1/functions" +[[edge_functions]] +path = "/og" +function = "og" + [build.environment] VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22" diff --git a/apps/web/netlify/edge-functions/og.tsx b/apps/web/netlify/edge-functions/og.tsx index 15cc4ee8e3..a9574aa425 100644 --- a/apps/web/netlify/edge-functions/og.tsx +++ b/apps/web/netlify/edge-functions/og.tsx @@ -100,9 +100,3 @@ export default function handler(req: Request) { // https://unpic.pics/og-edge return new ImageResponse(renderTemplate(params)); } - -// https://docs.netlify.com/build/edge-functions/declarations/#declare-edge-functions-inline -export const config = { - path: "/og", - cache: "manual", -}; From aa7bd26a2ed624ce8b70dfaa3f7f3a97fa328bf8 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:28:39 +0900 Subject: [PATCH 11/16] gave up --- apps/web/netlify.toml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index f39ddb0a9d..8f4a6929c8 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,17 +1,6 @@ -# https://docs.netlify.com/build/configure-builds/file-based-configuration/#build-settings [build] -base = "/" -package = "apps/web" -publish = "apps/web/dist/client" command = "pnpm -F @hypr/web build" - -[functions] -# https://docs.netlify.com/build/functions/optional-configuration/?data-tab=TypeScript -directory = "apps/web/.netlify/v1/functions" - -[[edge_functions]] -path = "/og" -function = "og" +publish = "dist/client" [build.environment] VITE_APP_URL = "https://hyprnote.com" From 66bd09c2e4086f01a0199a2fb5f31e3d02ba64d2 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:32:11 +0900 Subject: [PATCH 12/16] fix --- apps/web/netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 8f4a6929c8..5570c05619 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,6 +1,6 @@ [build] command = "pnpm -F @hypr/web build" -publish = "dist/client" +publish = "apps/web/dist/client" [build.environment] VITE_APP_URL = "https://hyprnote.com" From a5f6c1e54ffbe36c975077998573cdc36ea3b04f Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:34:56 +0900 Subject: [PATCH 13/16] wip --- apps/web/netlify.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 5570c05619..a5f4813779 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -2,6 +2,9 @@ command = "pnpm -F @hypr/web build" publish = "apps/web/dist/client" +[functions] +directory = "apps/web/.netlify/v1/functions" + [build.environment] VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22" From 0f282d89435438421291c091f310065be67a9272 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:37:02 +0900 Subject: [PATCH 14/16] please help --- apps/web/netlify.toml | 2 + apps/web/netlify/edge-functions/deno.json | 7 -- apps/web/netlify/edge-functions/og.tsx | 102 ---------------------- 3 files changed, 2 insertions(+), 109 deletions(-) delete mode 100644 apps/web/netlify/edge-functions/deno.json delete mode 100644 apps/web/netlify/edge-functions/og.tsx diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index a5f4813779..eb34cf87ed 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,4 +1,6 @@ [build] +base = "/" +package = "apps/web" command = "pnpm -F @hypr/web build" publish = "apps/web/dist/client" diff --git a/apps/web/netlify/edge-functions/deno.json b/apps/web/netlify/edge-functions/deno.json deleted file mode 100644 index a8e0f0ad09..0000000000 --- a/apps/web/netlify/edge-functions/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "lock": false, - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "https://esm.sh/react@18.2.0" - } -} diff --git a/apps/web/netlify/edge-functions/og.tsx b/apps/web/netlify/edge-functions/og.tsx deleted file mode 100644 index a9574aa425..0000000000 --- a/apps/web/netlify/edge-functions/og.tsx +++ /dev/null @@ -1,102 +0,0 @@ -// deno-lint-ignore-file no-import-prefix -/** @jsxImportSource https://esm.sh/react@18.2.0 */ -import { ImageResponse } from "https://deno.land/x/og_edge@0.0.6/mod.ts"; -import { z } from "https://deno.land/x/zod@v3.23.8/mod.ts"; - -const templateSchema = z.object({ - type: z.literal("meeting"), - title: z.string(), - headers: z.array(z.string()), -}); - -const OGSchema = z.discriminatedUnion("type", [templateSchema]); - -function parseSearchParams(url: URL): z.infer | null { - const type = url.searchParams.get("type"); - if (!type) { - return null; - } - - const title = url.searchParams.get("title"); - const headers = url.searchParams.getAll("headers"); - - const result = OGSchema.safeParse({ type, title, headers }); - return result.success ? result.data : null; -} - -function renderTemplate(params: z.infer) { - return ( -
-
-
- {params.title} -
-
- {params.headers.map((header, i) => ( -
-
- {header} -
- ))} -
-
-
- ); -} - -export default function handler(req: Request) { - const url = new URL(req.url); - const params = parseSearchParams(url); - - if (!params) { - return new Response(JSON.stringify({ error: "invalid_parameters" }), { - status: 400, - headers: { "Content-Type": "application/json" }, - }); - } - - // https://unpic.pics/og-edge - return new ImageResponse(renderTemplate(params)); -} From 34cc55d31672b691a38d000de47878903b9f2a56 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:39:58 +0900 Subject: [PATCH 15/16] v --- apps/web/netlify.toml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index eb34cf87ed..4988e9db2b 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,11 +1,10 @@ [build] -base = "/" -package = "apps/web" +base = "apps/web" command = "pnpm -F @hypr/web build" -publish = "apps/web/dist/client" +publish = "dist/client" [functions] -directory = "apps/web/.netlify/v1/functions" +directory = ".netlify/v1/functions" [build.environment] VITE_APP_URL = "https://hyprnote.com" From 2fb9f1e15b8bd219592a09a6307850c5d4632362 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Tue, 18 Nov 2025 16:43:06 +0900 Subject: [PATCH 16/16] wip --- apps/web/netlify.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 4988e9db2b..a3640b1a2f 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -3,9 +3,6 @@ base = "apps/web" command = "pnpm -F @hypr/web build" publish = "dist/client" -[functions] -directory = ".netlify/v1/functions" - [build.environment] VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22"