跳转到内容
This is an unmaintained snapshot of the Astro v4 docs. View the latest docs.

The middleware returned something that is not a Response object.

MiddlewareNotAResponse: 中间件返回的数据必须是一个合法的 Response 对象。

在开发模式下,当中间件返回的数据不是一个 Response 对象时抛出错误。

例如:

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

你有什么想法?

社区