-
카테고리
-
세부 분야
프론트엔드
-
해결 여부
미해결
The Middleware "/src/middleware" must export a middleware or a default function
24.05.16 23:27 작성 24.05.17 11:44 수정 조회수 143
0
미들웨어 matcher에 추가한 페이지 home으로 replace 시에 이렇게 에러가 뜨는데 이유를 모르겠습니다 ㅠ
⨯ Error [ERR_HTTP_HEADERS_SENT]: Cannot append headers after they are sent to the client
at ServerResponse.appendHeader (node:_http_outgoing:689:11)
at AsyncLocalStorage.run (node:async_hooks:346:14)
import { auth as middleware } from "./auth";
export const config = {
matcher: ["/compose/tweet", "/home", "/explore"],
};
답변을 작성해보세요.
1
조현영
지식공유자2024.05.16
https://github.com/ZeroCho/next-app-router-z/blob/master/ch3-1/src/middleware.ts
이렇게 미들웨어도 하나 있어야 합니다.
답변 1