Skip to content

中间件返回的不是 Response 对象。

MiddlewareNotAResponse:从中间件返回的任何数据都必须是有效的 Response 对象。

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

¥What went wrong?

当中间件返回非 Response 对象的内容时,抛出开发模式。

¥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"
});
Astro 中文网 - 粤ICP备13048890号