인프런 커뮤니티 질문&답변
The Middleware "/src/middleware" must export a middleware or a default function
작성
·
374
·
수정됨
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
1
제로초(조현영)
지식공유자
https://github.com/ZeroCho/next-app-router-z/blob/master/ch3-1/src/middleware.ts
이렇게 미들웨어도 하나 있어야 합니다.





