컨텐츠로 이동

The middleware returned something that is not a Response object.

이 컨텐츠는 아직 번역되지 않았습니다.

MiddlewareNotAResponse: Any data returned from middleware must be a valid Response object.

What went wrong?

Thrown in development mode when middleware returns something that is not a Response object.

For example:

import {defineMiddleware} from "astro:middleware";
export const onRequest = defineMiddleware(() => {
return "string"
});