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
5 changes: 3 additions & 2 deletions packages/api/src/trpc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { initTRPC, TRPCError } from "@trpc/server";
import type { TRPCDefaultErrorShape } from "@trpc/server";
import superjson from "superjson";
import { ZodError } from "zod";
import { z, ZodError } from "zod";
import type { Context } from "./context";
import {
rateLimit,
Expand All @@ -28,7 +28,8 @@ export const errorFormatter = ({
: shape.message,
data: {
...shape.data,
zodError: error.cause instanceof ZodError ? error.cause.flatten() : null,
zodError:
error.cause instanceof ZodError ? z.flattenError(error.cause) : null,
stack: isDev ? shape.data.stack : undefined, // Mask stack in production
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/db/drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as dotenv from "dotenv";
import path from "path";

// Load .env from root (two levels up)
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
dotenv.config({ path: path.resolve(__dirname, "../../.env"), quiet: true });

if (!process.env.DATABASE_URL) {
throw new Error("DATABASE_URL is not defined in .env file");
Expand Down
2 changes: 1 addition & 1 deletion packages/db/scripts/link-payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from "../src/services/membership";
import type { DrizzleDB } from "../src/client";

dotenv.config({ path: path.resolve(__dirname, "../../../.env") });
dotenv.config({ path: path.resolve(__dirname, "../../../.env"), quiet: true });

const APPLY = process.argv.includes("--apply");

Expand Down
2 changes: 1 addition & 1 deletion packages/db/scripts/seed-club-projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import * as dotenv from "dotenv";
import path from "path";

dotenv.config({ path: path.resolve(__dirname, "../../../.env") });
dotenv.config({ path: path.resolve(__dirname, "../../../.env"), quiet: true });

// `../src` is loaded inside main(): its client reads DATABASE_URL at module
// load, and a static *value* import would be hoisted above the dotenv call.
Expand Down
Loading