fix: remove middleware.ts conflicting with proxy.ts (Next.js 16)#50
Merged
TerrifiedBug merged 1 commit intomainfrom Mar 7, 2026
Merged
fix: remove middleware.ts conflicting with proxy.ts (Next.js 16)#50TerrifiedBug merged 1 commit intomainfrom
TerrifiedBug merged 1 commit intomainfrom
Conversation
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)
Contributor
Greptile SummaryThis PR resolves a Docker build failure introduced in PR #48 by removing
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant ProxyTS as proxy.ts
participant App
Note over ProxyTS: Exclusions: api/auth, api/v1,<br/>api/agent, _next/*, login, setup
Client->>ProxyTS: GET /api/v1/... (REST endpoint)
ProxyTS-->>App: Bypasses auth check
Client->>ProxyTS: GET /api/agent/... (Agent endpoint)
ProxyTS-->>App: Bypasses auth check
Client->>ProxyTS: GET /dashboard (authenticated user)
ProxyTS->>ProxyTS: Validate session via NextAuth
ProxyTS-->>App: Session valid, allow through
Client->>ProxyTS: GET /dashboard (unauthenticated)
ProxyTS->>ProxyTS: Validate session via NextAuth
ProxyTS-->>Client: Redirect to /login
Last reviewed commit: b3558dc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/middleware.tsalongside the existingsrc/proxy.ts, causing the Docker build to fail:"Both middleware file and proxy file are detected"src/middleware.ts— Next.js 16 replaced it withproxy.tsapi/v1exclusion toproxy.tsmatcher (was previously only inmiddleware.ts)Test plan