From b3558dc2877dd72aac3001a722a900e18f999c6d Mon Sep 17 00:00:00 2001 From: TerrifiedBug Date: Sat, 7 Mar 2026 18:01:01 +0000 Subject: [PATCH] fix: remove middleware.ts conflicting with proxy.ts (Next.js 16) Next.js 16 replaced middleware.ts with proxy.ts. PR #48 reintroduced middleware.ts alongside the existing proxy.ts, causing the Docker build to fail with "Both middleware file and proxy file are detected". - Delete src/middleware.ts - Add api/v1 exclusion to proxy.ts matcher (was only in middleware.ts) --- src/middleware.ts | 16 ---------------- src/proxy.ts | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 src/middleware.ts diff --git a/src/middleware.ts b/src/middleware.ts deleted file mode 100644 index 843b4724..00000000 --- a/src/middleware.ts +++ /dev/null @@ -1,16 +0,0 @@ -import NextAuth from "next-auth"; -import { authConfig } from "@/auth.config"; - -/** - * Edge-compatible middleware. Uses the lightweight auth.config.ts - * which does NOT import Prisma or any Node.js-only modules. - */ -const { auth } = NextAuth(authConfig); - -export default auth; - -export const config = { - matcher: [ - "/((?!api/auth|api/v1|api/agent|_next/static|_next/image|favicon.ico|login|setup).*)", - ], -}; diff --git a/src/proxy.ts b/src/proxy.ts index 64f47e46..188300de 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -11,6 +11,6 @@ export const proxy = auth; export const config = { matcher: [ - "/((?!api/auth|api/agent|_next/static|_next/image|favicon.ico|login|setup).*)", + "/((?!api/auth|api/v1|api/agent|_next/static|_next/image|favicon.ico|login|setup).*)", ], };