Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"ts-edge": "^1.0.4",
"ts-safe": "^0.0.5",
"tw-animate-css": "^1.4.0",
"undici": "^7.18.2",
"vaul": "^1.1.2",
"zod": "^4.2.1",
"zustand": "^5.0.9"
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ import { IS_VERCEL_ENV } from "lib/const";

export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
// Enable proxy support for undici (used by AI SDK) via HTTP_PROXY/HTTPS_PROXY env vars
const proxyUrl =
process.env.HTTPS_PROXY ||
process.env.https_proxy ||
process.env.HTTP_PROXY ||
process.env.http_proxy;
if (proxyUrl) {
const { ProxyAgent, setGlobalDispatcher } = await import("undici");
console.log(`[proxy] Using proxy for fetch requests: ${proxyUrl}`);
setGlobalDispatcher(new ProxyAgent(proxyUrl));
}
if (!IS_VERCEL_ENV) {
// run DB migration
const runMigrate = await import("./lib/db/pg/migrate.pg").then(
Expand Down
Loading